Skip to content

Commit 299bc6a

Browse files
authored
Merge branch 'main' into logrecord-state-processor
2 parents 585860d + 3c986e8 commit 299bc6a

35 files changed

+607
-367
lines changed

.github/workflows/ci-concurrency.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: Publish Artifacts
3737
if: always() && !cancelled()
38-
uses: actions/upload-artifact@v3
38+
uses: actions/upload-artifact@v4
3939
with:
4040
name: ${{ matrix.os }}-${{ matrix.project }}-${{ matrix.version }}-coyoteoutput
4141
path: '**/*_CoyoteOutput.*'

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
# Initializes the CodeQL tools for scanning.
3838
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@v2
39+
uses: github/codeql-action/init@v3
4040
with:
4141
languages: ${{ matrix.language }}
4242
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -47,7 +47,7 @@ jobs:
4747
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
4848
# If this step fails, then you should remove it and run the build manually (see below)
4949
- name: Autobuild
50-
uses: github/codeql-action/autobuild@v2
50+
uses: github/codeql-action/autobuild@v3
5151

5252
# Command-line programs to run using the OS shell.
5353
# https://git.io/JvXDl
@@ -61,4 +61,4 @@ jobs:
6161
# make release
6262

6363
- name: Perform CodeQL Analysis
64-
uses: github/codeql-action/analyze@v2
64+
uses: github/codeql-action/analyze@v3

.github/workflows/publish-packages-1.0.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: dotnet pack OpenTelemetry.proj --configuration Release --no-build --no-restore
3737

3838
- name: Publish Artifacts
39-
uses: actions/upload-artifact@v3
39+
uses: actions/upload-artifact@v4
4040
with:
4141
name: ${{ github.ref_name }}-packages
4242
path: '**/bin/**/*.*nupkg'

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
<OTelLatestStableVer>1.6.0</OTelLatestStableVer>
4+
<OTelLatestStableVer>1.7.0</OTelLatestStableVer>
55
</PropertyGroup>
66

77
<!--

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,12 @@ Here are the [instrumentation
5151
libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/glossary.md#instrumentation-library):
5252

5353
* [ASP.NET Core](./src/OpenTelemetry.Instrumentation.AspNetCore/README.md)
54-
* [Grpc.Net.Client](./src/OpenTelemetry.Instrumentation.GrpcNetClient/README.md)
55-
* [HTTP clients](./src/OpenTelemetry.Instrumentation.Http/README.md)
56-
* [SQL client](./src/OpenTelemetry.Instrumentation.SqlClient/README.md)
54+
* gRPC client:
55+
[Grpc.Net.Client](./src/OpenTelemetry.Instrumentation.GrpcNetClient/README.md)
56+
* HTTP clients: [System.Net.Http.HttpClient and
57+
System.Net.HttpWebRequest](./src/OpenTelemetry.Instrumentation.Http/README.md)
58+
* SQL clients: [Microsoft.Data.SqlClient and
59+
System.Data.SqlClient](./src/OpenTelemetry.Instrumentation.SqlClient/README.md)
5760

5861
Here are the [exporter
5962
libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/glossary.md#exporter-library):

build/RELEASING.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,16 @@ Only for Maintainers.
8484
git push origin 1.0.0-rc9.7
8585
```
8686
87-
If releasing both, push both tags above.
87+
If releasing only a particular non-core component which has a dedicated
88+
MinverTagPrefix such as AspNetCore instrumentation, only add and push the
89+
tag with that particular prefix. For example:
90+
91+
```sh
92+
git tag -a Instrumentation.AspNetCore-1.6.0 -m "1.6.0 of AspNetCore instrumentation library"
93+
git push origin Instrumentation.AspNetCore-1.6.0
94+
```
95+
96+
If releasing multiple kinds of components, push both tags for each of them.
8897
8998
7. Go to the [list of
9099
tags](https://github.com/open-telemetry/opentelemetry-dotnet/tags)

examples/AspNetCore/Instrumentation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public Instrumentation()
2222
string? version = typeof(Instrumentation).Assembly.GetName().Version?.ToString();
2323
this.ActivitySource = new ActivitySource(ActivitySourceName, version);
2424
this.meter = new Meter(MeterName, version);
25-
this.FreezingDaysCounter = this.meter.CreateCounter<long>("weather.days.freezing", "The number of days where the temperature is below freezing");
25+
this.FreezingDaysCounter = this.meter.CreateCounter<long>("weather.days.freezing", description: "The number of days where the temperature is below freezing");
2626
}
2727

2828
public ActivitySource ActivitySource { get; }

src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
* Export OpenMetrics format from Prometheus exporters ([#5107](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5107))
6+
* For requests with OpenMetrics format, scope info is automatically added ([#5086](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5086))
67

78
## 1.7.0-rc.1
89

src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
* Export OpenMetrics format from Prometheus exporters ([#5107](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5107))
6+
* For requests with OpenMetrics format, scope info is automatically added ([#5086](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5086))
67

78
## 1.7.0-rc.1
89

src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusCollectionManager.cs

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ internal sealed class PrometheusCollectionManager
1414
private readonly int scrapeResponseCacheDurationMilliseconds;
1515
private readonly Func<Batch<Metric>, ExportResult> onCollectRef;
1616
private readonly Dictionary<Metric, PrometheusMetric> metricsCache;
17+
private readonly HashSet<string> scopes;
1718
private int metricsCacheCount;
1819
private byte[] buffer = new byte[85000]; // encourage the object to live in LOH (large object heap)
1920
private int globalLockState;
@@ -29,6 +30,7 @@ public PrometheusCollectionManager(PrometheusExporter exporter)
2930
this.scrapeResponseCacheDurationMilliseconds = this.exporter.ScrapeResponseCacheDurationMilliseconds;
3031
this.onCollectRef = this.OnCollect;
3132
this.metricsCache = new Dictionary<Metric, PrometheusMetric>();
33+
this.scopes = new HashSet<string>();
3234
}
3335

3436
#if NET6_0_OR_GREATER
@@ -170,6 +172,37 @@ private ExportResult OnCollect(Batch<Metric> metrics)
170172

171173
try
172174
{
175+
this.scopes.Clear();
176+
177+
foreach (var metric in metrics)
178+
{
179+
if (PrometheusSerializer.CanWriteMetric(metric))
180+
{
181+
if (this.scopes.Add(metric.MeterName))
182+
{
183+
try
184+
{
185+
cursor = PrometheusSerializer.WriteScopeInfo(this.buffer, cursor, metric.MeterName);
186+
187+
break;
188+
}
189+
catch (IndexOutOfRangeException)
190+
{
191+
if (!this.IncreaseBufferSize())
192+
{
193+
// there are two cases we might run into the following condition:
194+
// 1. we have many metrics to be exported - in this case we probably want
195+
// to put some upper limit and allow the user to configure it.
196+
// 2. we got an IndexOutOfRangeException which was triggered by some other
197+
// code instead of the buffer[cursor++] - in this case we should give up
198+
// at certain point rather than allocating like crazy.
199+
throw;
200+
}
201+
}
202+
}
203+
}
204+
}
205+
173206
foreach (var metric in metrics)
174207
{
175208
if (!PrometheusSerializer.CanWriteMetric(metric))
@@ -194,12 +227,6 @@ private ExportResult OnCollect(Batch<Metric> metrics)
194227
{
195228
if (!this.IncreaseBufferSize())
196229
{
197-
// there are two cases we might run into the following condition:
198-
// 1. we have many metrics to be exported - in this case we probably want
199-
// to put some upper limit and allow the user to configure it.
200-
// 2. we got an IndexOutOfRangeException which was triggered by some other
201-
// code instead of the buffer[cursor++] - in this case we should give up
202-
// at certain point rather than allocating like crazy.
203230
throw;
204231
}
205232
}

0 commit comments

Comments
 (0)