What is an analogue of the publishing-to-pushgateway mechanism class in opentelemetry or another mechanism for sending metrics from a Windows application to the Web application (which collects all metrics by application names and sends them to Prometheus)? Both applications are hosted in docker containers.
https://github.com/prometheus-net/prometheus-net?tab=readme-ov-file#publishing-to-pushgateway
It’s interesting to use this pattern in the example code for sending and receiving metrics.
I don’t fully understand the work of an open-telemetry-collector, but I think it performs other functions.
public class Program
{
private static readonly ActivitySource MyActivitySource = new("OpenTelemetry.Demo.Exemplar");
public static void Main()
{
var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("OpenTelemetry.Demo.Exemplar")
.AddOtlpExporter()
.Build();
var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter("OpenTelemetry.Demo.Exemplar")
.AddOtlpExporter((exporterOptions, metricReaderOptions) =>
{
exporterOptions.Endpoint = new Uri("http://localhost:9090/api/v1/otlp/v1/metrics");
exporterOptions.Protocol = OtlpExportProtocol.HttpProtobuf;
})
.Build();
Ксения Юдина is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.