Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changesets/config_telemetry_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Add basic config file options to otel telemetry - @swcollard PR #330

Adds new Configuration options for setting up configuration beyond the standard OTEL environment variables needed before.

* Renames trace->telemetry
* Adds OTLP options for metrics and tracing to choose grpc or http upload protocols and setting the endpoints
* This configuration is all optional, so by default nothing will be logged
70 changes: 70 additions & 0 deletions .changesets/feat_allow_attribute_configuration_alocay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
### feat: adding ability to omit attributes for traces and metrics - @alocay PR #358

Adding ability to configure which attributes are omitted from telemetry traces and metrics.

1. Using a Rust build script (`build.rs`) to auto-generate telemetry attribute code based on the data found in `telemetry.toml`.
2. Utilizing an enum for attributes so typos in the config file raise an error.
3. Omitting trace attributes by filtering it out in a custom exporter.
4. Omitting metric attributes by indicating which attributes are allowed via a view.
5. Created `telemetry_attributes.rs` to map `TelemetryAttribute` enum to a OTEL `Key`.

The `telemetry.toml` file includes attributes (both for metrics and traces) as well as list of metrics gathered. An example would look like the following:
```
[attributes.apollo.mcp]
my_attribute = "Some attribute info"

[metrics.apollo.mcp]
some.count = "Some metric count info"
```
This would generate a file that looks like the following:
```
/// All TelemetryAttribute values
pub const ALL_ATTRS: &[TelemetryAttribute; 1usize] = &[
TelemetryAttribute::MyAttribute
];
#[derive(Debug, ::serde::Deserialize, ::schemars::JsonSchema,, Clone, Eq, PartialEq, Hash, Copy)]
pub enum TelemetryAttribute {
///Some attribute info
#[serde(alias = "my_attribute")]
MyAttribute,
}
impl TelemetryAttribute {
/// Supported telemetry attribute (tags) values
pub const fn as_str(&self) -> &'static str {
match self {
TelemetryAttribute::MyAttribute => "apollo.mcp.my_attribute",
}
}
}
#[derive(Debug, ::serde::Deserialize, ::schemars::JsonSchema,, Clone, Eq, PartialEq, Hash, Copy)]
pub enum TelemetryMetric {
///Some metric count info
#[serde(alias = "some.count")]
SomeCount,
}
impl TelemetryMetric {
/// Converts TelemetryMetric to &str
pub const fn as_str(&self) -> &'static str {
match self {
TelemetryMetric::SomeCount => "apollo.mcp.some.count",
}
}
}
```
An example configuration that omits `tool_name` attribute for metrics and `request_id` for tracing would look like the following:
```
telemetry:
exporters:
metrics:
otlp:
endpoint: "http://localhost:4317"
protocol: "grpc"
omitted_attributes:
- tool_name
tracing:
otlp:
endpoint: "http://localhost:4317"
protocol: "grpc"
omitted_attributes:
- request_id
```
11 changes: 11 additions & 0 deletions .changesets/feat_otel_metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Implement metrics for mcp tool and operation counts and durations - @swcollard PR #297

This PR adds metrics to count and measure request duration to events throughout the MCP server

* apollo.mcp.operation.duration
* apollo.mcp.operation.count
* apollo.mcp.tool.duration
* apollo.mcp.tool.count
* apollo.mcp.initialize.count
* apollo.mcp.list_tools.count
* apollo.mcp.get_info.count
9 changes: 9 additions & 0 deletions .changesets/feat_otel_prototype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Prototype OpenTelemetry Traces in MCP Server - @swcollard PR #274

Pulls in new crates and SDKs for prototyping instrumenting the Apollo MCP Server with Open Telemetry Traces.

* Adds new rust crates to support OTel
* Annotates excecute and call_tool functions with trace macro
* Adds Axum and Tower middleware's for OTel tracing
* Refactors Logging so that all the tracing_subscribers are set together in a single module.

4 changes: 4 additions & 0 deletions .changesets/feat_telemetry_operations_trace_metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Telemetry: Trace operations and auth - @swcollard PR #375

* Adds traces for the MCP server generating Tools from Operations and performing authorization
* Includes the HTTP status code to the top level HTTP trace
8 changes: 8 additions & 0 deletions .changesets/feat_trace_sampling_option_alocay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### feat: adding config option for trace sampling - @alocay PR #366

Adding configuration option to sample traces. Can use the following options:
1. Ratio based samples (ratio >= 1 is always sample)
2. Always on
3. Always off

Defaults to always on if not provided.
3 changes: 3 additions & 0 deletions .changesets/fix_telemetry_fix_downstream_traces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### fix: Include the cargo feature and TraceContextPropagator to send otel headers downstream - @swcollard PR #307

Inside the reqwest middleware, if the global text_map_propagator is not set, it will no op and not send the traceparent and tracestate headers to the Router. Adding this is needed to correlate traces from the mcp server to the router or other downstream APIs
Loading