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

add otel push exporter #137

Merged
merged 8 commits into from
Sep 12, 2023
Merged

add otel push exporter #137

merged 8 commits into from
Sep 12, 2023

Conversation

mellowagain
Copy link
Member

@mellowagain mellowagain commented Sep 7, 2023

adds new features:

  • otel-push-exporter (parent feature, enabled automatically if one of the features below are)
  • protocols: otel-push-exporter-http and otel-push-exporter-grpc
  • runtimes: otel-push-exporter-tokio, otel-push-exporter-tokio-current-thread and otel-push-exporter-async-std

in the documentation we should advise on using those features if one wants to use the otel push exporter. the exporter can be invoked easily by calling

otel_push_exporter::init_http("url")?;
// or
otel_push_exporter::init_grpc("url")?;

depending on which feature flags are enabled and which protocol one wants to use. the returned OtelMeterProvider has a custom Drop implementation which will ensure that .shutdown is called before the provider is dropped.

init_http_with_timeout_period(
url,
Duration::from_secs(OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT),
Duration::from_secs(1),
Copy link
Collaborator

@hatchan hatchan Sep 11, 2023

Choose a reason for hiding this comment

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

This period is that the same as push interval? If so, then I think we should not use such a low value, not sure what would be a better value 🤔 Maybe something like 30 seconds.

Copy link
Member Author

Choose a reason for hiding this comment

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

im actually thinking maybe we shouldnt set these at all. then otlp exporter would fall back to using the env variables OTEL_METRIC_EXPORT_TIMEOUT and OTEL_METRIC_EXPORT_INTERVAL and if not found fall back to the default value, currently 30 timeout and 60 interval

Copy link
Member Author

Choose a reason for hiding this comment

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

i have done so now

Copy link
Member

Choose a reason for hiding this comment

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

I forgot about this, using 30 seconds is probably the better default, but also maybe it'll create struggles with the explorer with the build_info metric being looked for only on the last second. Didn't have time to test Brett's fix, maybe that's not an issue anymore

@hatchan
Copy link
Collaborator

hatchan commented Sep 11, 2023

The only thing that I think we need is some docs about how to use this in the README or autometrics-dev/docs

@mellowagain mellowagain enabled auto-merge (squash) September 12, 2023 13:24
@mellowagain mellowagain merged commit 88ad063 into main Sep 12, 2023
1 check passed
@mellowagain mellowagain deleted the otel-push-exporter branch September 12, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants