-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,511 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Example auto instrumentation plugin for OpenTelemetry .NET | ||
|
||
This is a very minimal .NET application that we use to validate our OpenTelemetry plugin loads correctly | ||
|
||
This happens automated through our testing setup: | ||
|
||
```bash | ||
$ ./build.sh test --test-suite=integration | ||
``` | ||
|
||
Which ends up running the tests in `/tests/AutoInstrumentation.IntegrationTests` | ||
|
||
|
||
To quickly see the `DockerFile` in action run the following from the root of this repository. | ||
|
||
|
||
```bash | ||
$ docker build -t example.autoinstrumentation:latest -f examples/Example.AutoInstrumentation/Dockerfile --no-cache . && \ | ||
docker run -it --rm -p 5000:8080 --name autoin example.autoinstrumentation:latest | ||
``` |
17 changes: 0 additions & 17 deletions
17
...elemetry.AutoInstrumentationPlugin/Elastic.OpenTelemetry.AutoInstrumentationPlugin.csproj
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to Elasticsearch B.V under one or more agreements. | ||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||
// See the LICENSE file in the project root for more information | ||
|
||
namespace Elastic.OpenTelemetry.Configuration; | ||
|
||
internal class ConfigCell<T>(string key, T value) | ||
{ | ||
public string Key { get; } = key; | ||
public T? Value { get; private set; } = value; | ||
public ConfigSource Source { get; set; } = ConfigSource.Default; | ||
|
||
public void Assign(T value, ConfigSource source) | ||
{ | ||
Value = value; | ||
Source = source; | ||
} | ||
|
||
public override string ToString() => $"{Key}: '{Value}' from [{Source}]"; | ||
} | ||
internal enum ConfigSource | ||
{ | ||
Default, // Default value assigned within this class | ||
Environment, // Loaded from an environment variable | ||
// ReSharper disable once InconsistentNaming | ||
IConfiguration, // Bound from an IConfiguration instance | ||
Property // Set via property initializer | ||
} |
29 changes: 29 additions & 0 deletions
29
src/Elastic.OpenTelemetry/Configuration/ElasticDefaults.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Licensed to Elasticsearch B.V under one or more agreements. | ||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||
// See the LICENSE file in the project root for more information | ||
|
||
namespace Elastic.OpenTelemetry.Configuration; | ||
|
||
/// <summary> | ||
/// Control which elastic defaults you want to include. | ||
/// <para>NOTE: this is an expert level option only use this if you want to take full control of the OTEL configuration</para> | ||
/// <para>defaults to <see cref="ElasticDefaults.All"/></para> | ||
/// </summary> | ||
[Flags] | ||
public enum ElasticDefaults | ||
{ | ||
/// <summary> No Elastic defaults will be included, acting effectively as a vanilla OpenTelemetry </summary> | ||
None, | ||
|
||
/// <summary> Include Elastic Distribution for OpenTelemetry .NET tracing defaults</summary> | ||
Traces = 1 << 0, //1 | ||
|
||
/// <summary> Include Elastic Distribution for OpenTelemetry .NET metrics defaults</summary> | ||
Metrics = 1 << 1, //2 | ||
|
||
/// <summary> Include Elastic Distribution for OpenTelemetry .NET logging defaults</summary> | ||
Logs = 1 << 2, //4 | ||
|
||
/// <summary> (default) Include all Elastic Distribution for OpenTelemetry .NET logging defaults</summary> | ||
All = ~0 | ||
} |
Oops, something went wrong.