Skip to content

Commit

Permalink
Merge branch 'main' into users/dulikvor/markinstrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas authored Dec 18, 2024
2 parents 0d24004 + 7d7d37a commit 937ccf4
Show file tree
Hide file tree
Showing 21 changed files with 318 additions and 362 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Component.BuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
required: false
type: string
os-list:
default: '[ "windows-latest", "ubuntu-latest", "otel-linux-arm64" ]'
default: '[ "windows-latest", "ubuntu-22.04", "otel-linux-arm64" ]'
required: false
type: string
tfm-list:
Expand All @@ -37,7 +37,7 @@ jobs:
os: ${{ fromJSON(inputs.os-list) }}
version: ${{ fromJSON(inputs.tfm-list) }}
exclude:
- os: ubuntu-latest
- os: ubuntu-22.04
version: net462
- os: otel-linux-arm64
version: net462
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/add-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
add-labels-on-issues:
if: github.event_name == 'issues' && !github.event.issue.pull_request

runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: check out code
Expand All @@ -35,7 +35,7 @@ jobs:
add-labels-on-pull-requests:
if: github.event_name == 'pull_request_target'

runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: check out code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:
resolve-automation:

runs-on: ubuntu-latest
runs-on: ubuntu-22.04

outputs:
enabled: ${{ steps.evaluate.outputs.enabled }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
|| contains(needs.detect-changes.outputs.changes, 'otlp')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand All @@ -125,7 +125,7 @@ jobs:
|| contains(needs.detect-changes.outputs.changes, 'instrumentation')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
concurrency-tests
]
if: always() && !cancelled()
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- run: |
if ( ${{ contains(needs.*.result, 'failure') }} == true ); then echo 'build failed'; exit 1; else echo 'build complete'; fi
2 changes: 1 addition & 1 deletion .github/workflows/concurrency-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
os: [ windows-latest, ubuntu-22.04 ]
version: [ net8.0 ]
project: [ OpenTelemetry.Tests, OpenTelemetry.Api.Tests ]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
run-markdownlint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: check out code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
secrets: inherit

push-packages-and-publish-release:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

needs: automation

Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
-pushToNuget '${{ secrets.NUGET_TOKEN != '' }}'
post-release-published:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

needs:
- automation
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
secrets: inherit

prepare-release-pr:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

needs: automation

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
-gitUserEmail '${{ needs.automation.outputs.email }}'
lock-pr-and-post-notice-to-create-release-tag:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

needs: automation

Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
-botUserName '${{ needs.automation.outputs.username }}'
create-release-tag-pr-post-notice:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

needs: automation

Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
-gitUserEmail '${{ needs.automation.outputs.email }}'
update-changelog-release-dates-on-prepare-pr-post-notice:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

needs: automation

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-packages-1.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
nuget push src/**/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package
post-build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

needs:
- automation
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sanitycheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
run-misspell:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: check out code
Expand All @@ -22,7 +22,7 @@ jobs:
run: ./bin/misspell -error .

run-sanitycheck:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: check out code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
stale:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/stale@v9
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verifyaotcompat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ ubuntu-latest, windows-latest ]
os: [ ubuntu-22.04, windows-latest ]
version: [ net8.0, net9.0 ]

runs-on: ${{ matrix.os }}
Expand Down
28 changes: 24 additions & 4 deletions examples/AspNetCore/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenTelemetry ASP.NET Core 7 Web API Example
# OpenTelemetry ASP.NET Core Web API Example

This example uses the new WebApplication host that ships with .NET 7
This example uses the new WebApplication host that ships with .NET
and shows how to setup

1. OpenTelemetry logging
Expand All @@ -13,7 +13,27 @@ service name, version and the machine on which this program is running.
The sample rate is set to emit all the traces using `AlwaysOnSampler`.
You can try out different samplers like `TraceIdRatioBasedSampler`.

## Running Dependencies via Docker

The example by default writes telemetry to stdout. To enable telemetry export
via OTLP, update the `appsettings.json` file to replace `"console"` with
`"otlp"`. Launching the application will then send telemetry data via OTLP.

Use the provided "docker-compose.yaml" file to spin up the
required dependencies, including:

- **OTel Collector** Accept telemetry and forwards them to Tempo, Prometheus
- **Prometheus** to store metrics
- **Grafana (UI)** UI to view metrics, traces. (Exemplars can be used to jump
from metrics to traces)
- **Tempo** to store traces // TODO: Add a logging store also.

Once the Docker containers are running, you can access the **Grafana UI** at:
[http://localhost:3000/](http://localhost:3000/)

## References

* [ASP.NET Core 3.1 Example](https://github.com/open-telemetry/opentelemetry-dotnet/tree/98cb28974af43fc893ab80a8cead6e2d4163e144/examples/AspNetCore)
* [OpenTelemetry Project](https://opentelemetry.io/)
- [ASP.NET Core](https://learn.microsoft.com/aspnet/core/introduction-to-aspnet-core)
- [Docker](http://docker.com)
- [Prometheus](http://prometheus.io/docs)
- [Tempo](https://github.com/grafana/tempo)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\PeriodicExportingMetricReaderHelper.cs" Link="Includes\PeriodicExportingMetricReaderHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\PeerServiceResolver.cs" Link="Includes\PeerServiceResolver.cs" />
<Compile Include="$(RepoRoot)\src\Shared\TagWriter\ArrayTagWriter.cs" Link="Includes\TagWriter\ArrayTagWriter.cs" />
<Compile Include="$(RepoRoot)\src\Shared\TagWriter\TagWriter.cs" Link="Includes\TagWriter\TagWriter.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

syntax = "proto3";

package opentelemetry.proto.collector.profiles.v1experimental;
package opentelemetry.proto.collector.profiles.v1development;

import "opentelemetry/proto/profiles/v1experimental/profiles.proto";
import "opentelemetry/proto/profiles/v1development/profiles.proto";

option csharp_namespace = "OpenTelemetry.Proto.Collector.Profiles.V1Experimental";
option csharp_namespace = "OpenTelemetry.Proto.Collector.Profiles.V1Development";
option java_multiple_files = true;
option java_package = "io.opentelemetry.proto.collector.profiles.v1experimental";
option java_package = "io.opentelemetry.proto.collector.profiles.v1development";
option java_outer_classname = "ProfilesServiceProto";
option go_package = "go.opentelemetry.io/proto/otlp/collector/profiles/v1experimental";
option go_package = "go.opentelemetry.io/proto/otlp/collector/profiles/v1development";

// Service that can be used to push profiles between one Application instrumented with
// OpenTelemetry and a collector, or between a collector and a central collector.
Expand All @@ -38,7 +38,7 @@ message ExportProfilesServiceRequest {
// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
// data from multiple origins typically batch the data before forwarding further and
// in that case this array will contain multiple elements.
repeated opentelemetry.proto.profiles.v1experimental.ResourceProfiles resource_profiles = 1;
repeated opentelemetry.proto.profiles.v1development.ResourceProfiles resource_profiles = 1;
}

message ExportProfilesServiceResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ type: google.api.Service
config_version: 3
http:
rules:
- selector: opentelemetry.proto.collector.profiles.v1experimental.ProfilesService.Export
post: /v1experimental/profiles
- selector: opentelemetry.proto.collector.profiles.v1development.ProfilesService.Export
post: /v1development/profiles
body: "*"
20 changes: 18 additions & 2 deletions src/Shared/Proto/opentelemetry/proto/logs/v1/logs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ message ResourceLogs {
repeated ScopeLogs scope_logs = 2;

// The Schema URL, if known. This is the identifier of the Schema that the resource data
// is recorded in. To learn more about Schema URL see
// is recorded in. Notably, the last part of the URL path is the version number of the
// schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see
// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
// This schema_url applies to the data in the "resource" field. It does not apply
// to the data in the "scope_logs" field which have their own schema_url field.
Expand All @@ -74,7 +75,8 @@ message ScopeLogs {
repeated LogRecord log_records = 2;

// The Schema URL, if known. This is the identifier of the Schema that the log data
// is recorded in. To learn more about Schema URL see
// is recorded in. Notably, the last part of the URL path is the version number of the
// schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see
// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
// This schema_url applies to all logs in the "logs" field.
string schema_url = 3;
Expand Down Expand Up @@ -208,4 +210,18 @@ message LogRecord {
// - the field is not present,
// - the field contains an invalid value.
bytes span_id = 10;

// A unique identifier of event category/type.
// All events with the same event_name are expected to conform to the same
// schema for both their attributes and their body.
//
// Recommended to be fully qualified and short (no longer than 256 characters).
//
// Presence of event_name on the log record identifies this record
// as an event.
//
// [Optional].
//
// Status: [Development]
string event_name = 12;
}
33 changes: 28 additions & 5 deletions src/Shared/Proto/opentelemetry/proto/metrics/v1/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ option go_package = "go.opentelemetry.io/proto/otlp/metrics/v1";
// storage, OR can be embedded by other protocols that transfer OTLP metrics
// data but do not implement the OTLP protocol.
//
// MetricsData
// └─── ResourceMetrics
// ├── Resource
// ├── SchemaURL
// └── ScopeMetrics
// ├── Scope
// ├── SchemaURL
// └── Metric
// ├── Name
// ├── Description
// ├── Unit
// └── data
// ├── Gauge
// ├── Sum
// ├── Histogram
// ├── ExponentialHistogram
// └── Summary
//
// The main difference between this message and collector protocol is that
// in this message there will not be any "control" or "metadata" specific to
// OTLP protocol.
Expand Down Expand Up @@ -56,7 +74,8 @@ message ResourceMetrics {
repeated ScopeMetrics scope_metrics = 2;

// The Schema URL, if known. This is the identifier of the Schema that the resource data
// is recorded in. To learn more about Schema URL see
// is recorded in. Notably, the last part of the URL path is the version number of the
// schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see
// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
// This schema_url applies to the data in the "resource" field. It does not apply
// to the data in the "scope_metrics" field which have their own schema_url field.
Expand All @@ -74,7 +93,8 @@ message ScopeMetrics {
repeated Metric metrics = 2;

// The Schema URL, if known. This is the identifier of the Schema that the metric data
// is recorded in. To learn more about Schema URL see
// is recorded in. Notably, the last part of the URL path is the version number of the
// schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see
// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
// This schema_url applies to all metrics in the "metrics" field.
string schema_url = 3;
Expand All @@ -85,7 +105,6 @@ message ScopeMetrics {
//
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md
//
//
// The data model and relation between entities is shown in the
// diagram below. Here, "DataPoint" is the term used to refer to any
// one of the specific data point value types, and "points" is the term used
Expand All @@ -97,7 +116,7 @@ message ScopeMetrics {
// - DataPoint contains timestamps, attributes, and one of the possible value type
// fields.
//
// Metric
// Metric
// +------------+
// |name |
// |description |
Expand Down Expand Up @@ -251,6 +270,9 @@ message ExponentialHistogram {
// data type. These data points cannot always be merged in a meaningful way.
// While they can be useful in some applications, histogram data points are
// recommended for new applications.
// Summary metrics do not have an aggregation temporality field. This is
// because the count and sum fields of a SummaryDataPoint are assumed to be
// cumulative values.
message Summary {
repeated SummaryDataPoint data_points = 1;
}
Expand Down Expand Up @@ -589,7 +611,8 @@ message ExponentialHistogramDataPoint {
}

// SummaryDataPoint is a single data point in a timeseries that describes the
// time-varying values of a Summary metric.
// time-varying values of a Summary metric. The count and sum fields represent
// cumulative values.
message SummaryDataPoint {
reserved 1;

Expand Down
Loading

0 comments on commit 937ccf4

Please sign in to comment.