Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
6916c84
[Prometheus.HttpListener] Add env vars support
martincostello Apr 25, 2026
8495e5a
[Prometheus.HttpListener] Fix lint warnings
martincostello Apr 25, 2026
1d08846
[Prometheus.HttpListener] Add coverage
martincostello Apr 25, 2026
bfbc246
[Prometheus.HttpListener] Fix README snippets
martincostello Apr 25, 2026
e598fbb
[Exporter.Prometheus] Fix-up merge
martincostello Apr 27, 2026
7adc4f4
[Prometheus.HttpListener] Fix merge
martincostello Apr 28, 2026
2faa7ae
[Exporter.Prometheus] Update Accept handling
martincostello Apr 30, 2026
d61ed6c
[Exporter.Prometheus] Address review comments
martincostello May 1, 2026
ab6f944
[Exporter.Prometheus] Use canonical representations
martincostello Apr 29, 2026
8544d12
[Exporter.Prometheus] Update CHANGELOGs
martincostello Apr 29, 2026
2fef7d3
[Exporter.Prometheus] Extend test coverage
martincostello Apr 29, 2026
135b40b
[Exporter.Prometheus] Remove unreachable code
martincostello Apr 29, 2026
534ef9c
[Exporter.Prometheus] Address feedback
martincostello Apr 29, 2026
38772fb
[Exporter.Prometheus] Fix untyped for OpenMetrics
martincostello Apr 29, 2026
e38b8a7
[Exporter.Prometheus] Fix OpenMetrics histograms
martincostello Apr 29, 2026
4656b1f
[Exporter.Prometheus] Fix CHANGELOGs
martincostello Apr 29, 2026
aaf830e
[Exporter.Prometheus] Export _created series
martincostello Apr 29, 2026
e26bafb
[Exporter.Prometheus] Address feedback
martincostello Apr 29, 2026
f6d8c67
[Exporter.Prometheus] Address feedback
martincostello May 1, 2026
ffb6559
[Exporter.Prometheus] Fix-up merge
martincostello May 1, 2026
b8609aa
[Exporter.Prometheus] Fix SA1507 warning
martincostello May 1, 2026
9454950
[Exporter.Prometheus] Fix test
martincostello May 1, 2026
995e4cc
[Exporter.Prometheus] Fix scope metadata
martincostello May 1, 2026
138f4ef
[Exporter.Prometheus] Update test cases
martincostello May 1, 2026
5b82173
[Exporter.Prometheus] Update CHANGELOGs
martincostello May 1, 2026
fa5ddcc
[Exporter.Prometheus] Address feedback
martincostello May 1, 2026
767aa01
[Exporter.Prometheus] Extend coverage
martincostello May 1, 2026
d7ad536
[Exporter.Prometheus] Add target_info fallback
martincostello May 1, 2026
574fde1
[Exporter.Prometheus] Update CHANGELOGs
martincostello May 1, 2026
9bfbdb1
[Exporter.Prometheus] Merge colliding label keys
martincostello May 1, 2026
6507246
[Exporter.Prometheus] Update CHANGELOGs
martincostello May 1, 2026
70ef846
[Exporter.Prometheus] Address feedback
martincostello May 1, 2026
67be1ee
[Exporter.Prometheus] Extend coverage
martincostello May 1, 2026
8d97d02
[Exporter.Prometheus] Dedupe metadata
martincostello May 1, 2026
7d3aad5
[Exporter.Prometheus] Address feedback
martincostello May 1, 2026
3851591
[Exporter.Prometheus] Extend coverage
martincostello May 1, 2026
d91f75e
Fix Prometheus merge regressions
martincostello May 3, 2026
c4a2242
[Exporter.Prometheus] Tweak formatting
martincostello May 3, 2026
936b177
[Exporter.Prometheus] Validate with promtool
martincostello May 3, 2026
2c678a6
[Exporter.Prometheus] Fix warnings
martincostello May 3, 2026
1d426b9
[Exporter.Prometheus] Fix build
martincostello May 3, 2026
b007718
[Exporter.Prometheus] Fix tests
martincostello May 3, 2026
260aa7f
[Exporter.Prometheus] Fix tests
martincostello May 3, 2026
7dd8ebe
[Exporter.Prometheus] FIx namespace
martincostello May 3, 2026
7cdfc97
[Exporter.Prometheus] Fix tests
martincostello May 3, 2026
b98a644
[Exporter.Prometheus] Fix tests
martincostello May 3, 2026
a65aad3
[Exporter.Prometheus] Update comment
martincostello May 3, 2026
2bba11e
[Exporter.Prometheus] Update tests
martincostello May 3, 2026
0c4a4ed
[Exporter.Prometheus] Address comments
martincostello May 3, 2026
2aba375
[Exporter.Prometheus] Fix CHANGELOGs
martincostello May 3, 2026
1fccc58
Merge branch 'main' into prometheus-compatibility-fixes
martincostello May 4, 2026
5b98a4e
[Exporter.Prometheus] Fix fuzz tests
martincostello May 4, 2026
aec37e8
Merge branch 'main' into prometheus-compatibility-fixes
martincostello May 4, 2026
530b6c7
[Prometheus.AspNetCore] Extend integration tests
martincostello May 4, 2026
b7052a0
[Prometheus.AspNetCore] Fix warnings
martincostello May 4, 2026
e143acf
[Prometheus.AspNetCore] Fix typo
martincostello May 4, 2026
e447fa3
[Prometheus.AspNetCore] Fix build
martincostello May 4, 2026
3c9ac81
[Prometheus.AspNetCore] Add extra host
martincostello May 4, 2026
f655912
[Prometheus.AspNetCore] Fix-up asserts
martincostello May 4, 2026
23fb958
[Prometheus.AspNetCore] Output logs
martincostello May 4, 2026
a133dca
[Prometheus.AspNetCore] Set file permissions
martincostello May 4, 2026
52353f6
Merge branch 'main' into prometheus-compatibility-fixes
martincostello May 5, 2026
019a826
[Prometheus.AspNetCore] Extend integration tests
martincostello May 5, 2026
0f018e2
[Exporter.Prometheus] Observe request timeout
martincostello May 5, 2026
9bdc57a
[Exporter.Prometheus] Update CHANGELOGs
martincostello May 5, 2026
83a2c13
[Prometheus.AspNetCore] Address review comments
martincostello May 5, 2026
0823dd0
[Exporter.Prometheus] Extend content negotiation
martincostello May 6, 2026
c23bf43
[Exporter.Prometheus] Use immutable collections
martincostello May 6, 2026
260a367
[Exporter.Prometheus] Update CHANGELOGs
martincostello May 6, 2026
b7ff4db
[Exporter.Prometheus] Address feedback
martincostello May 6, 2026
4752f5e
Merge branch 'main' into prometheus-compatibility-fixes
martincostello May 7, 2026
8a23f77
Merge remote-tracking branch 'origin/extend-prometheus-integration-te…
martincostello May 7, 2026
e67837a
Merge remote-tracking branch 'origin/Observe-X-Prometheus-Scrape-Time…
martincostello May 7, 2026
d0f7441
Merge remote-tracking branch 'origin/extend-content-negotiation' into…
martincostello May 7, 2026
14938cc
[Prometheus.AspNetCore] Fix merge
martincostello May 7, 2026
0458ee8
[Prometheus.AspNetCore] Support OTEL_SDK_DISABLED
martincostello May 7, 2026
54bc9f1
[Prometheus.AspNetCore] Fix test
martincostello May 7, 2026
75234c4
[Prometheus.AspNetCore] Update CHANGELOG
martincostello May 7, 2026
fb0b57b
[Prometheus.AspNetCore] Address feedback
martincostello May 7, 2026
5e90244
[Prometheus.AspNetCore] Extend integration tests
martincostello May 5, 2026
ca448e5
[Prometheus.AspNetCore] Address review comments
martincostello May 5, 2026
af91589
[Prometheus.AspNetCore] Support GZip
martincostello May 7, 2026
9019f3b
Merge branch 'prometheus-handle-OTEL_SDK_DISABLED' into prometheus-co…
martincostello May 8, 2026
51f7f74
Merge branch 'gh-7213' into prometheus-compatibility-fixes
martincostello May 8, 2026
3638d11
[Exporter.Prometheus] Improve performance
martincostello May 9, 2026
ecbf64c
Merge branch 'main' into prometheus-compatibility-fixes
martincostello May 14, 2026
ccbb615
Merge branch 'prometheus-compatibility-fixes' into improve-prometheus…
martincostello May 14, 2026
8f537c1
Merge branch 'main' into prometheus-compatibility-fixes
martincostello May 18, 2026
d64c5f7
[Prometheus.AspNetCore] Fix merge
martincostello May 18, 2026
9113322
Merge branch 'prometheus-compatibility-fixes' into improve-prometheus…
martincostello May 18, 2026
62845b2
Merge branch 'main' into prometheus-compatibility-fixes
martincostello May 19, 2026
67e17dc
Merge branch 'main' into prometheus-compatibility-fixes
martincostello May 22, 2026
2882aa4
Merge branch 'prometheus-compatibility-fixes' into improve-prometheus…
martincostello May 22, 2026
d6f6a06
Merge branch 'main' into improve-prometheus-performance
martincostello Jun 4, 2026
8d2d604
[Exporter.Prometheus] Revert some changes
martincostello Jun 4, 2026
b8cc739
[Exporter.Prometheus] Restore optimisations
martincostello Jun 4, 2026
4e79170
[Exporter.Prometheus] Revert change
martincostello Jun 4, 2026
536ac67
Merge branch 'main' into improve-prometheus-performance
martincostello Jun 5, 2026
691286e
[Exporter.Prometheus] Simplify defines
martincostello Jun 5, 2026
a751364
[Exporter.Prometheus] Address feedback
martincostello Jun 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ private ExportResult OnCollect(in Batch<Metric> metrics)

break;
}
catch (IndexOutOfRangeException)
catch (Exception ex) when (ex is IndexOutOfRangeException or ArgumentException)
{
if (!IncreaseBufferSize(ref buffer))
{
Expand All @@ -276,7 +276,7 @@ private ExportResult OnCollect(in Batch<Metric> metrics)
cursor = PrometheusSerializer.WriteEof(buffer, cursor);
break;
}
catch (IndexOutOfRangeException)
catch (Exception ex) when (ex is IndexOutOfRangeException or ArgumentException)
{
if (!IncreaseBufferSize(ref buffer))
{
Expand Down Expand Up @@ -328,7 +328,7 @@ private int WriteTargetInfo(ref byte[] buffer)
targetInfoBufferLength = PrometheusSerializer.WriteTargetInfo(buffer, 0, this.exporter.Resource, this.exporter.OpenMetricsRequested);
break;
}
catch (IndexOutOfRangeException)
catch (Exception ex) when (ex is IndexOutOfRangeException or ArgumentException)
{
if (!IncreaseBufferSize(ref buffer))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ public PrometheusMetric(string name, string unit, PrometheusType type, bool disa
this.OpenMetricsMetadataName = openMetricsMetadataName;
this.Unit = sanitizedUnit;
this.Type = type;
this.NameBytes = ConvertToAsciiBytes(sanitizedName);
this.OpenMetricsNameBytes = ConvertToAsciiBytes(openMetricsName);
this.OpenMetricsMetadataNameBytes = ConvertToAsciiBytes(openMetricsMetadataName);
this.UnitBytes = sanitizedUnit == null ? null : ConvertToAsciiBytes(sanitizedUnit);

static byte[] ConvertToAsciiBytes(string value)
{
// Metric names and units are sanitized before conversion, so every character here is ASCII
var bytes = new byte[value.Length];
Comment thread
Kielek marked this conversation as resolved.

for (var i = 0; i < value.Length; i++)
{
bytes[i] = unchecked((byte)value[i]);
}

return bytes;
}
}

public string Name { get; }
Expand All @@ -76,6 +93,14 @@ public PrometheusMetric(string name, string unit, PrometheusType type, bool disa

public PrometheusType Type { get; }

internal byte[] NameBytes { get; }

internal byte[] OpenMetricsNameBytes { get; }

internal byte[] OpenMetricsMetadataNameBytes { get; }

internal byte[]? UnitBytes { get; }

public static PrometheusMetric Create(Metric metric, bool disableTotalNameSuffixForCounters)
=> new(metric.Name, metric.Unit, GetPrometheusType(metric.MetricType), disableTotalNameSuffixForCounters);

Expand Down
Loading
Loading