-
Notifications
You must be signed in to change notification settings - Fork 759
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
I was writing an example application and forgot to set the meter provider. Running the code resulted in output bring printed, which led me in a rabbit hole of trying to figure out why my metrics weren't being produced, when in fact I'd missed the important step of using the MeterProvider.
Note this behaviour is different from the ConsoleSpanExporter which doesn't print any output if it's not used.
Steps to reproduce
Run the following code:
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics.export import (
ConsoleMetricExporter,
PeriodicExportingMetricReader,
)
reader = PeriodicExportingMetricReader(ConsoleMetricExporter())
provider = MeterProvider(metric_readers=[reader])What is the expected behavior?
Since I did not configure or use the provider in anyway, I was expecting not to see anything.
What is the actual behavior?
The following printed:
{"resource_metrics": [{"resource": {"attributes": {"telemetry.sdk.language": "python", "telemetry.sdk.name": "opentelemetry", "telemetry.sdk.version": "1.17.0.dev0", "service.name": "unknown_service"}, "schema_url": ""}, "scope_metrics": [], "schema_url": ""}]}Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working