Skip to content

Bump Tessera & switch to OpenTelemetry #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 9, 2025

Conversation

AlCutter
Copy link
Collaborator

@AlCutter AlCutter commented Apr 8, 2025

This PR bumps the tessera dep to HEAD, and updates monitoring in this package to adopt OpenTelemetry as used in Tessera.

Existing prometheus metric have been migrated to OTel, and a few initial top-level trace spans added to show how it works. More metrics & traces could be added as the code stablises.

The GCP binary has been updated to auto-export telemetry to Cloud Monitoring.

For now, I've removed the prometheus metrics exporting from the AWS binary and OTel export support will need to be added at a later date.

@AlCutter AlCutter requested a review from phbnf April 8, 2025 16:54
@AlCutter AlCutter added enhancement New feature or request dependencies Pull requests that update a dependency file labels Apr 8, 2025
@AlCutter AlCutter assigned AlCutter and phbnf and unassigned AlCutter Apr 8, 2025
@AlCutter AlCutter marked this pull request as ready for review April 8, 2025 16:55

lastSCTTimestamp = mustCreate(meter.Int64Gauge("tesseract.last_sct.timestamp",
metric.WithDescription("Time of last SCT since epoch"),
metric.WithUnit("ms")))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(To avoid ambiguity with my other comment, let's keep ms here since this is the unit in the RFC)

metric.WithDescription("Index of last SCT"),
metric.WithUnit("{entry}")))

reqsCounter = mustCreate(meter.Int64Counter("tesseract.http_request.count",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rspLatency = mustCreate(meter.Float64Histogram("tesseract.http_response.duration",
metric.WithDescription("CT HTTP response duration"),
metric.WithExplicitBucketBoundaries(otel.LatencyHistogramBuckets...),
metric.WithUnit("ms")))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use seconds here as a unit: it's Opentelemetry's default unit for time. I think we should also rename this metric to http_request.duration rather, to align with https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#metric-httpserverrequestduration. I can't tell for sure, but should this be tesseract.http.request.count rather?

In all fairness: If I were to write this from scratch, I'd use latency... and if I could not use latency I would use "response.duration". But it looks like people who've thought about this for some time have made other decisions, let's stick to default and embrace Opentelemtry way of doing things.

Name: "http_reqs",
Help: "Number of requests",
},
[]string{"origin", "ep"})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I gather correctly that we can't specify attributes at metric creation time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a feature that's coming, but still "in development".
We should be able to come back and add such "advisory attributes" later: https://opentelemetry.io/docs/specs/otel/metrics/api/#instrument-advisory-parameter-attributes

)

var (
codeKey = attribute.Key("tesseract.code")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be status_code from https://opentelemetry.io/docs/specs/semconv/http/http-metrics/

@AlCutter AlCutter merged commit 96ce8e4 into transparency-dev:main Apr 9, 2025
7 checks passed
@AlCutter AlCutter deleted the bump_tessera branch April 9, 2025 10:04
phbnf added a commit to phbnf/tesseract that referenced this pull request Apr 10, 2025
phbnf added a commit to phbnf/tesseract that referenced this pull request Apr 10, 2025
phbnf added a commit to phbnf/tesseract that referenced this pull request Apr 11, 2025
This reverts commit 96ce8e4.

# Conflicts:
#	internal/scti/handlers.go
phbnf added a commit to phbnf/tesseract that referenced this pull request Apr 11, 2025
This reverts commit 96ce8e4.

# Conflicts:
#	internal/scti/handlers.go

# Conflicts:
#	go.mod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants