Skip to content
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

Does MeterProvider support OTLP HttpExporter? #2522

Closed
zakimaksyutov opened this issue Oct 27, 2021 · 9 comments · Fixed by #2696
Closed

Does MeterProvider support OTLP HttpExporter? #2522

zakimaksyutov opened this issue Oct 27, 2021 · 9 comments · Fixed by #2696
Labels
enhancement New feature or request metrics Metrics signal related question Further information is requested

Comments

@zakimaksyutov
Copy link

Question

I'm trying to emit metrics using OTLP HttpExporter (ConsoleExporter works) but nothing is getting sent. I wonder whether HttpExporter is supported for Metrics path?

  <ItemGroup>
    <PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.2.0-beta1" />
    <PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.2.0-beta1" />
  </ItemGroup>
private static readonly Meter MyMeter = new Meter("ConsoleWithOTel.Meters", "1.0");
private static readonly Counter<long> IncomingRequestsCounter = MyMeter.CreateCounter<long>("IncomingRequests");

private static async Task Main(string[] args)
{
    using var meterProvider = Sdk.CreateMeterProviderBuilder()
        .AddMeter("ConsoleWithOTel.Meters")
        //.AddConsoleExporter(options => { options.MetricExportIntervalMilliseconds = 1000; })
        .AddOtlpExporter(opt =>
        {
            opt.MetricExportIntervalMilliseconds = 1000;
            opt.Endpoint = new Uri("https://bla.com/v1/metrics");
            opt.ExportProcessorType = ExportProcessorType.Simple; // tried Batch as well
            opt.Protocol = OtlpExportProtocol.HttpProtobuf; // Is this option supported?
        })
        .Build();

    IncomingRequestsCounter.Add(1, new KeyValuePair<string, object>("version", "v1"));
    IncomingRequestsCounter.Add(1, new KeyValuePair<string, object>("version", "v1"));
    IncomingRequestsCounter.Add(1, new KeyValuePair<string, object>("version", "v1"));
    IncomingRequestsCounter.Add(1, new KeyValuePair<string, object>("version", "v2"));
    IncomingRequestsCounter.Add(1, new KeyValuePair<string, object>("version", "v3"));
            
    Console.WriteLine($"{DateTimeOffset.UtcNow:O} Press any key to stop...");
    Console.ReadKey();
}
@zakimaksyutov zakimaksyutov added the question Further information is requested label Oct 27, 2021
@cijothomas
Copy link
Member

opt.Protocol = OtlpExportProtocol.HttpProtobuf; // Is this option supported?

Not for metrics.

@zakimaksyutov
Copy link
Author

Thank you! Is the vision that eventually it should be supported? If yes - wonder whether it is already on a roadmap?

@cijothomas
Copy link
Member

Thank you! Is the vision that eventually it should be supported? If yes - wonder whether it is already on a roadmap?

Eventually yes. It's not planned for 1.2 stable release but @alanwest might know if the feature is small and can be included in the 1.2 release timeframe.

@alanwest
Copy link
Member

Yes, I think this is doable in the 1.2 release timeframe. @rypdal did great work establishing the pattern for traces. Should not be too difficult to apply to both metrics and logs. @rypdal did you have any plans to do this? If not, this is something I could pick up soon.

@rypdal
Copy link
Contributor

rypdal commented Oct 29, 2021

On the 2nd of November (Tu.) there will be some internal company's planning / sync session. After that I can say if can pick it up. I can let you know during the next "OpenTelemetry .NET SDK SIG sync up" (also the 2nd of November). But if it's more urgent then @alanwest can pick it up as well. Theoretically implementation of metrics/logs export should be rather straightforward. Just one thing. It makes sense to merge the #2492 Otlp http exporter: allow endpoint override first.

@cijothomas cijothomas added enhancement New feature or request metrics Metrics signal related labels Oct 29, 2021
@cijothomas
Copy link
Member

Tagging with metrics, enhancement labels. Not marking as "required-for-ga" for Metrics, as this is not a blocker for 1.2 Metric release (OTLP+grpc alone is sufficient for that).

In other words, this'd be nice to have for 1.2, and may land in 1.2, but not required/won't block 1.2.

@greaterthanmost
Copy link

@cijothomas Has it been confirmed whether or not the Http protocol will be included in the 1.2 release yet?

@rypdal
Copy link
Contributor

rypdal commented Nov 17, 2021

I can add from my side that, unfortunately, there are some internal company's things popped up in the latest time and there is no possibility to make this contribution for me at the moment.

@greaterthanmost
Copy link

I can add from my side that, unfortunately, there are some internal company's things popped up in the latest time and there is no possibility to make this contribution for me at the moment.

Okay cool. Thank you for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request metrics Metrics signal related question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants