Skip to content
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

feat: add opentelemetry tracer and metrics #679

Merged
merged 3 commits into from
Sep 26, 2022
Merged

feat: add opentelemetry tracer and metrics #679

merged 3 commits into from
Sep 26, 2022

Conversation

hf
Copy link
Contributor

@hf hf commented Sep 12, 2022

Adds support for OpenTelemetry tracing and metrics, in addition to the existing support for OpenTracing via DataDog.

Please consult the README on how to configure it. Here are some excerpts:

Tracing

To enable tracing configure these variables:

GOTRUE_TRACING_ENABLED - boolean

GOTRUE_TRACING_EXPORTER - string only opentracing (deprecated) and opentelemetry supported

Make sure you also configure the OpenTelemetry Exporter configuration for your collector or service.

For example, if you use Honeycomb.io you should set these standard OpenTelemetry OTLP variables:

OTEL_SERVICE_NAME=gotrue
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_EXPORTER_OTLP_ENDPOINT=https://api.honeycomb.io:443
OTEL_EXPORTER_OTLP_HEADERS="x-honeycomb-team=<API-KEY>,x-honeycomb-dataset=gotrue"

Metrics

To enable metrics configure these variables:

GOTRUE_METRICS_ENABLED - boolean

GOTRUE_METRICS_EXPORTER - string only opentelemetry and prometheus supported

Make sure you also configure the OpenTelemetry Exporter configuration for your collector or service.

If you use the prometheus exporter, the server host and port can be configured using these standard OpenTelemetry variables:

OTEL_EXPORTER_PROMETHEUS_HOST - IP address, default 0.0.0.0

OTEL_EXPORTER_PROMETHEUS_PORT - port number, default 9100

The metrics are exported on the / path on the server.

If you use the opentelemetry exporter, the metrics are pushed to the
collector.

For example, if you use Honeycomb.io you should set these standard OpenTelemetry OTLP variables:

OTEL_SERVICE_NAME=gotrue
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_EXPORTER_OTLP_ENDPOINT=https://api.honeycomb.io:443
OTEL_EXPORTER_OTLP_HEADERS="x-honeycomb-team=<API-KEY>,x-honeycomb-dataset=gotrue"

Note that Honeycomb.io requires a paid plan to ingest metrics.

If you need to debug an issue with traces or metrics not being pushed, you can set DEBUG=true to get more insights from the OpenTelemetry SDK.

(OpenTracing is being deprecated as of this PR, will be removed in the next few releases.)

Builds upon the excellent work by @HarryET in #524.

@hf hf force-pushed the hf/opentelemetry branch 2 times, most recently from 132e348 to 4cbbc31 Compare September 15, 2022 11:42
@hf hf force-pushed the hf/opentelemetry branch from 4cbbc31 to 2ee7597 Compare September 15, 2022 13:43
@hf hf force-pushed the hf/opentelemetry branch 5 times, most recently from 7e996b6 to abdf10e Compare September 16, 2022 08:06
@hf hf force-pushed the hf/opentelemetry branch 2 times, most recently from d738273 to dcf59b5 Compare September 16, 2022 12:12
@hf hf force-pushed the hf/opentelemetry branch 2 times, most recently from 90ea76b to b770f70 Compare September 16, 2022 13:29
@hf hf force-pushed the hf/opentelemetry branch from b770f70 to d75e194 Compare September 16, 2022 14:10
@hf hf marked this pull request as ready for review September 16, 2022 14:11
@hf hf requested a review from a team as a code owner September 16, 2022 14:11
@hf hf force-pushed the hf/opentelemetry branch 2 times, most recently from e35f79c to 8d0c3a4 Compare September 22, 2022 12:25
conf/metrics.go Outdated Show resolved Hide resolved
@hf
Copy link
Contributor Author

hf commented Sep 22, 2022

Hey @kangmingtay, @J0, @HarryET this is now small enough to be reviewed. I suggest creating a free account on honeycomb.io and following the instructions in the PR to see the traces. Metrics can be seen by using the Prometheus exporter and visiting localhost:9100.

@hf hf force-pushed the hf/opentelemetry branch from cbde419 to 9363d02 Compare September 26, 2022 08:38
@hf hf force-pushed the hf/opentelemetry branch from 9363d02 to f82303b Compare September 26, 2022 08:43
@hf hf merged commit 650fa3b into master Sep 26, 2022
@hf hf deleted the hf/opentelemetry branch September 26, 2022 09:13
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.17.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@J0 J0 mentioned this pull request Nov 10, 2023
J0 added a commit that referenced this pull request Nov 12, 2023
## What kind of change does this PR introduce?

As per [this PR](#679) and the we
have deprecated opentracing and are removing it in favour of
opentelemetry.

This will make the update of the opentelemetry dependcies easier as we
no longer have to consider opentracing specific dependencies.


Relevant internal context:
https://supabase.slack.com/archives/C022071RB2L/p1699451083111579

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
uxodb pushed a commit to uxodb/auth that referenced this pull request Nov 13, 2024
* feat: add opentelemetry tracing and metrics

* docs: update README

* refactor: use OTEL standard vars for prometheus

Co-authored-by: HarryET <29015545+HarryET@users.noreply.github.com>
uxodb pushed a commit to uxodb/auth that referenced this pull request Nov 13, 2024
## What kind of change does this PR introduce?

As per [this PR](supabase#679) and the we
have deprecated opentracing and are removing it in favour of
opentelemetry.

This will make the update of the opentelemetry dependcies easier as we
no longer have to consider opentracing specific dependencies.


Relevant internal context:
https://supabase.slack.com/archives/C022071RB2L/p1699451083111579

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 13, 2024
* feat: add opentelemetry tracing and metrics

* docs: update README

* refactor: use OTEL standard vars for prometheus

Co-authored-by: HarryET <29015545+HarryET@users.noreply.github.com>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 13, 2024
## What kind of change does this PR introduce?

As per [this PR](supabase#679) and the we
have deprecated opentracing and are removing it in favour of
opentelemetry.

This will make the update of the opentelemetry dependcies easier as we
no longer have to consider opentracing specific dependencies.


Relevant internal context:
https://supabase.slack.com/archives/C022071RB2L/p1699451083111579

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 15, 2024
* feat: add opentelemetry tracing and metrics

* docs: update README

* refactor: use OTEL standard vars for prometheus

Co-authored-by: HarryET <29015545+HarryET@users.noreply.github.com>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 15, 2024
## What kind of change does this PR introduce?

As per [this PR](supabase#679) and the we
have deprecated opentracing and are removing it in favour of
opentelemetry.

This will make the update of the opentelemetry dependcies easier as we
no longer have to consider opentracing specific dependencies.


Relevant internal context:
https://supabase.slack.com/archives/C022071RB2L/p1699451083111579

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants