opentelemetry-dotnet icon indicating copy to clipboard operation
opentelemetry-dotnet copied to clipboard

Configuration layer similar to .NET ILogger configuration to control individual meter states

Open dpk83 opened this issue 2 years ago • 3 comments

Feature Request

Support controlling meter state for individual meters via configuration similar to how .NET ILogger configuration let's you configure log level based on logger.

i.e. One should be able to control meter states something like

{
    "MeterState": "Enabled",  // Default state for all meters is enabled, Use the override to override further 
    "MeterStateOverrides": {
        "X.Y.Z": "Disabled",
        "X.Y.Z.ABC": "Enabled",
        "A.B": "Disabled"
    }
}

or can follow the same model as logging, something like

{
    "Metering": {
        "MeterState": {
            "Default": "Enabled",
            "X.Y.Z": "Disabled",
            "X.Y.Z.ABC": "Enabled",
            "A.B": "Disabled",
        }
    }
}

Is your feature request related to a problem? Yes.

If so, provide a concise description of the problem. Currently, there is no easy way to control these things via configuration and controlling these requires code changes. In our services almost everything is controllable via configuration for better control.

Describe the solution you'd like:

What do you want to happen instead? What is the expected behavior?

Describe alternatives you've considered.

Wrote our own configuration layer on top to achieve this.

Additional Context

Add any other context about the feature request here.

dpk83 avatar Mar 20 '23 22:03 dpk83

AddMeter(ABC.).AddMeter(XYZ.) etc - are these not sufficient? You can read the list of MeterNames from IConfiguration and feed it to AddMeter([]metername) - won't that work? The ILogger filter capability is not something OTel provides, and the AddMeter functionality is matching the AddSource functionality today.

cijothomas avatar Mar 21 '23 04:03 cijothomas

@dpk83 please check https://github.com/open-telemetry/oteps/pull/225. There is an ongoing discussion how to make configuration in the file. I am not sure if all your needs will be addressed, but worth to check and give feedback.

Kielek avatar Mar 21 '23 09:03 Kielek

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

github-actions[bot] avatar Oct 15 '24 03:10 github-actions[bot]

Closed as inactive. Feel free to reopen if this issue is still a concern.

github-actions[bot] avatar Oct 23 '24 03:10 github-actions[bot]