-
Notifications
You must be signed in to change notification settings - Fork 46
feat: adding ability to omit attributes for traces and metrics #358
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
Conversation
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 2 changed, 0 removedBuild ID: dcc498b7fd512a9837b8c86f URL: https://www.apollographql.com/docs/deploy-preview/dcc498b7fd512a9837b8c86f |
| } | ||
|
|
||
| #[tracing::instrument(skip(self, context), fields(tool_name = request.name.as_ref(), request_id = %context.id.clone()))] | ||
| #[tracing::instrument(skip(self, context), fields(apollo.mcp.attribute.tool_name = request.name.as_ref(), apollo.mcp.attribute.request_id = %context.id.clone()))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I have not figured out a way to use the const variables from the generated code in this fields() section.
| let mut filtering_exporter = FilteringExporter::new(mock_exporter, HashSet::new()); | ||
| filtering_exporter.set_resource(&Resource::builder_empty().build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test missing an assert? Or does not throwing an error show that it's working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assert is within the innner set_resource call which has:
assert!(true);
It's not an amazing test but since set_resource doesn't return anything I just assert within the set_resource function and call it day. Although this isn't great since calling nothing will also pass but I could not think of another way to ensure this. If any other inner function is called, it'll fail.
* feat: adding ability to omit attributes for traces and metrics * chore: adding changeset * chore: updating changeset text * chore: removing unused file * chore: renaming exporter file * chore: renaming module * re-running checks * chore: auto-gen the as_str function using enums instead of constants * chore: updating changeset entry and fixing fields in instruemnt attribute * chore: adding description as a doc string * chore: updating changeset entry * chore: updating operation attribute descriptions * chore: updating operation_type attribute to operation_source * chore: skipping request from instrumentation * chore: fixing clippy issues * re-running nix build * updating unit test snapshot * chore: fixing toml formatting issues * test: removing asserts on constants * chore: format issues * test: adjusting unit test to not use local envar * revert: undoing accidental commit * test: removing unnecessary assert
* feat: adding ability to omit attributes for traces and metrics * chore: adding changeset * chore: updating changeset text * chore: removing unused file * chore: renaming exporter file * chore: renaming module * re-running checks * chore: auto-gen the as_str function using enums instead of constants * chore: updating changeset entry and fixing fields in instruemnt attribute * chore: adding description as a doc string * chore: updating changeset entry * chore: updating operation attribute descriptions * chore: updating operation_type attribute to operation_source * chore: skipping request from instrumentation * chore: fixing clippy issues * re-running nix build * updating unit test snapshot * chore: fixing toml formatting issues * test: removing asserts on constants * chore: format issues * test: adjusting unit test to not use local envar * revert: undoing accidental commit * test: removing unnecessary assert
* feat: adding ability to omit attributes for traces and metrics * chore: adding changeset * chore: updating changeset text * chore: removing unused file * chore: renaming exporter file * chore: renaming module * re-running checks * chore: auto-gen the as_str function using enums instead of constants * chore: updating changeset entry and fixing fields in instruemnt attribute * chore: adding description as a doc string * chore: updating changeset entry * chore: updating operation attribute descriptions * chore: updating operation_type attribute to operation_source * chore: skipping request from instrumentation * chore: fixing clippy issues * re-running nix build * updating unit test snapshot * chore: fixing toml formatting issues * test: removing asserts on constants * chore: format issues * test: adjusting unit test to not use local envar * revert: undoing accidental commit * test: removing unnecessary assert
* feat: adding ability to omit attributes for traces and metrics * chore: adding changeset * chore: updating changeset text * chore: removing unused file * chore: renaming exporter file * chore: renaming module * re-running checks * chore: auto-gen the as_str function using enums instead of constants * chore: updating changeset entry and fixing fields in instruemnt attribute * chore: adding description as a doc string * chore: updating changeset entry * chore: updating operation attribute descriptions * chore: updating operation_type attribute to operation_source * chore: skipping request from instrumentation * chore: fixing clippy issues * re-running nix build * updating unit test snapshot * chore: fixing toml formatting issues * test: removing asserts on constants * chore: format issues * test: adjusting unit test to not use local envar * revert: undoing accidental commit * test: removing unnecessary assert
* feat: adding ability to omit attributes for traces and metrics * chore: adding changeset * chore: updating changeset text * chore: removing unused file * chore: renaming exporter file * chore: renaming module * re-running checks * chore: auto-gen the as_str function using enums instead of constants * chore: updating changeset entry and fixing fields in instruemnt attribute * chore: adding description as a doc string * chore: updating changeset entry * chore: updating operation attribute descriptions * chore: updating operation_type attribute to operation_source * chore: skipping request from instrumentation * chore: fixing clippy issues * re-running nix build * updating unit test snapshot * chore: fixing toml formatting issues * test: removing asserts on constants * chore: format issues * test: adjusting unit test to not use local envar * revert: undoing accidental commit * test: removing unnecessary assert
* feat: adding ability to omit attributes for traces and metrics * chore: adding changeset * chore: updating changeset text * chore: removing unused file * chore: renaming exporter file * chore: renaming module * re-running checks * chore: auto-gen the as_str function using enums instead of constants * chore: updating changeset entry and fixing fields in instruemnt attribute * chore: adding description as a doc string * chore: updating changeset entry * chore: updating operation attribute descriptions * chore: updating operation_type attribute to operation_source * chore: skipping request from instrumentation * chore: fixing clippy issues * re-running nix build * updating unit test snapshot * chore: fixing toml formatting issues * test: removing asserts on constants * chore: format issues * test: adjusting unit test to not use local envar * revert: undoing accidental commit * test: removing unnecessary assert
Adding ability to configure which attributes are omitted from telemetry traces and metrics.
build.rs) to auto-generate telemetry attribute code based on the data found intelemetry.toml.telemetry_attributes.rsto mapTelemetryAttributeenum to a OTELKey.The
telemetry.tomlfile includes attributes (both for metrics and traces) as well as list of metrics gathered. An example would look like the following:This would generate a file that looks like the following:
An example configuration that omits
tool_nameattribute for metrics andrequest_idfor tracing would look like the following: