Problem Statement
When configuring telemetry and setting up the meter similar to:
from strands.telemetry import StrandsTelemetry
strands_telemetry = StrandsTelemetry()
strands_telemetry.setup_otlp_exporter()
strands_telemetry.setup_meter(enable_otlp_exporter=True)
I want to be able to pass views to StrandsTelemetry.setup_meter(), as this cannot be configured unless I explicitly set strands_telemetry.meter_provider myself similar to how StrandsTelemetry.setup_meter already does it.
Proposed Solution
I propose StrandsTelemetry.setup_meter() includes an optional argument for views, so that the metric provider configures the views alongside the readers its already configuring.
from strands.telemetry import StrandsTelemetry
views = [
View(instrument_name="*", aggregation=DropAggregation()),
View(instrument_name="mycounter"),
]
strands_telemetry = StrandsTelemetry()
strands_telemetry.setup_otlp_exporter()
strands_telemetry.setup_meter(enable_otlp_exporter=True, views=views) # the proposed change
Use Case
I need to filter out certain tags we do not need (like tool_use_id and event_loop_cycle_id) that are high-cardinality and would like to increased custom metric costs with vendors like Datadog.
Alternatives Solutions
No response
Additional Context
Let me know what you all think and (if needed) I can open the PR myself for the change.
Problem Statement
When configuring telemetry and setting up the meter similar to:
I want to be able to pass
viewstoStrandsTelemetry.setup_meter(), as this cannot be configured unless I explicitly setstrands_telemetry.meter_providermyself similar to howStrandsTelemetry.setup_meteralready does it.Proposed Solution
I propose
StrandsTelemetry.setup_meter()includes an optional argument for views, so that the metric provider configures the views alongside the readers its already configuring.Use Case
I need to filter out certain tags we do not need (like
tool_use_idandevent_loop_cycle_id) that are high-cardinality and would like to increased custom metric costs with vendors like Datadog.Alternatives Solutions
No response
Additional Context
Let me know what you all think and (if needed) I can open the PR myself for the change.