Skip to content

Commit

Permalink
Merge branch 'main' into issue/AWS-Lambda-SQS-SNS-support
Browse files Browse the repository at this point in the history
  • Loading branch information
rypdal committed Mar 29, 2023
2 parents e88edbe + 131b149 commit 5ce87e1
Show file tree
Hide file tree
Showing 54 changed files with 1,593 additions and 187 deletions.
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/comp_sampler_aws.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: OpenTelemetry.Sampler.AWS
about: Issue with OpenTelemetry.Sampler.AWS
labels: comp:sampler.aws
---

# Issue with OpenTelemetry.Sampler.AWS

List of [all OpenTelemetry NuGet
packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are
using (e.g. `OpenTelemetry 1.3.2`):

* TBD

Runtime version (e.g. `net462`, `net48`, `net6.0`, `net7.0` etc. You can
find this information from the `*.csproj` file):

* TBD

**Is this a feature request or a bug?**

* [ ] Feature Request
* [ ] Bug

**What is the expected behavior?**

What do you expect to see?

**What is the actual behavior?**

What did you see instead? If you are reporting a bug, create a self-contained
project using the template of your choice and apply the minimum required code to
result in the issue you're observing. We will close this issue if:

* The repro project you share with us is complex. We can't investigate custom
projects, so don't point us to such, please.
* If we can not reproduce the behavior you're reporting.

## Additional Context

Add any other context about the feature request here.
8 changes: 7 additions & 1 deletion .github/component_owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ components:
src/OpenTelemetry.ResourceDetectors.Azure/:
- rajkumar-rangaraj
- vishweshbankwar
src/OpenTelemetry.Sampler.AWS/:
- srprash
test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/:
- srprash
- lupengamzn
Expand Down Expand Up @@ -103,6 +105,9 @@ components:
- SergeyKanzhelev
test/OpenTelemetry.Extensions.Tests/:
- codeblanch
test/OpenTelemetry.Extensions.AzureMonitor.Tests/:
- rajkumar-rangaraj
- vishweshbankwar
test/OpenTelemetry.Extensions.Docker.Tests/:
- iskiselev
test/OpenTelemetry.Extensions.Enrichment.Tests/:
Expand Down Expand Up @@ -137,4 +142,5 @@ components:
test/OpenTelemetry.ResourceDetectors.Azure.Tests/:
- rajkumar-rangaraj
- vishweshbankwar

test/OpenTelemetry.Sampler.AWS.Tests/:
- srprash
67 changes: 67 additions & 0 deletions .github/workflows/package-Sampler.AWS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Pack OpenTelemetry.Sampler.AWS

on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
push:
tags:
- 'Sampler.AWS-*' # trigger when we create a tag with prefix "Sampler.AWS-"

jobs:
build-test-pack:
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
PROJECT: OpenTelemetry.Sampler.AWS

strategy:
matrix:
os: [windows-latest]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetching all

- uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.x'

- name: Install dependencies
run: dotnet restore src/${{env.PROJECT}}

- name: dotnet build ${{env.PROJECT}}
run: dotnet build src/${{env.PROJECT}} --configuration Release --no-restore -p:Deterministic=true

- name: dotnet test ${{env.PROJECT}}
run: dotnet test test/${{env.PROJECT}}.Tests

- name: dotnet pack ${{env.PROJECT}}
run: dotnet pack src/${{env.PROJECT}} --configuration Release --no-build

- name: Publish Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{env.PROJECT}}-packages
path: '**/${{env.PROJECT}}/bin/**/*.*nupkg'

- name: Publish Nuget
run: |
nuget push **/${{env.PROJECT}}/bin/**/*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_TOKEN }} -SymbolApiKey ${{ secrets.NUGET_TOKEN }}
- name: Create GitHub Prerelease
if: ${{ (contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') || contains(github.ref_name, '-rc.')) }}
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --verify-tag --notes "See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/${{ github.ref_name }}/src/${{env.PROJECT}}/CHANGELOG.md) for details." --prerelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
if: ${{ !(contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') || contains(github.ref_name, '-rc.')) }}
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --verify-tag --notes "See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/${{ github.ref_name }}/src/${{env.PROJECT}}/CHANGELOG.md) for details." --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions build/Common.nonprod.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<OpenTelemetryExporterInMemoryLatestPreReleasePkgVer>$(OpenTelemetryCoreLatestPrereleaseVersion)</OpenTelemetryExporterInMemoryLatestPreReleasePkgVer>
<XUnitRunnerVisualStudioPkgVer>[2.4.3,3.0)</XUnitRunnerVisualStudioPkgVer>
<XUnitPkgVer>[2.4.2,3.0)</XUnitPkgVer>
<WiremockNetPkgVer>[1.5.20,2.0)</WiremockNetPkgVer>
</PropertyGroup>

</Project>
14 changes: 14 additions & 0 deletions opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.PersistentSto
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.PersistentStorage.FileSystem.Tests", "test\OpenTelemetry.PersistentStorage.FileSystem.Tests\OpenTelemetry.PersistentStorage.FileSystem.Tests.csproj", "{C7215B69-0D77-4D52-AFBB-A6662249B3AC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTelemetry.Sampler.AWS", "src\OpenTelemetry.Sampler.AWS\OpenTelemetry.Sampler.AWS.csproj", "{54002B08-F6AE-4B2B-AB0C-86E5A05926A3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTelemetry.Sampler.AWS.Tests", "test\OpenTelemetry.Sampler.AWS.Tests\OpenTelemetry.Sampler.AWS.Tests.csproj", "{48C29501-3FA2-46A7-B5BA-D282EA8F1274}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.OneCollector.Benchmarks", "test\OpenTelemetry.Exporter.OneCollector.Benchmarks\OpenTelemetry.Exporter.OneCollector.Benchmarks.csproj", "{C42868C8-968A-473F-AC39-AC97C5D47E84}"
EndProject
Global
Expand Down Expand Up @@ -552,6 +556,14 @@ Global
{C7215B69-0D77-4D52-AFBB-A6662249B3AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7215B69-0D77-4D52-AFBB-A6662249B3AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7215B69-0D77-4D52-AFBB-A6662249B3AC}.Release|Any CPU.Build.0 = Release|Any CPU
{54002B08-F6AE-4B2B-AB0C-86E5A05926A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54002B08-F6AE-4B2B-AB0C-86E5A05926A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54002B08-F6AE-4B2B-AB0C-86E5A05926A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54002B08-F6AE-4B2B-AB0C-86E5A05926A3}.Release|Any CPU.Build.0 = Release|Any CPU
{48C29501-3FA2-46A7-B5BA-D282EA8F1274}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48C29501-3FA2-46A7-B5BA-D282EA8F1274}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48C29501-3FA2-46A7-B5BA-D282EA8F1274}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48C29501-3FA2-46A7-B5BA-D282EA8F1274}.Release|Any CPU.Build.0 = Release|Any CPU
{C42868C8-968A-473F-AC39-AC97C5D47E84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C42868C8-968A-473F-AC39-AC97C5D47E84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C42868C8-968A-473F-AC39-AC97C5D47E84}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -641,6 +653,8 @@ Global
{EC73B88E-D544-4A6A-90D5-E291035FEA35} = {22DF5DC0-1290-4E83-A9D8-6BB7DE3B3E63}
{74EF2C61-9176-4D4E-91D3-E17E28054FF8} = {22DF5DC0-1290-4E83-A9D8-6BB7DE3B3E63}
{C7215B69-0D77-4D52-AFBB-A6662249B3AC} = {2097345F-4DD3-477D-BC54-A922F9B2B402}
{54002B08-F6AE-4B2B-AB0C-86E5A05926A3} = {22DF5DC0-1290-4E83-A9D8-6BB7DE3B3E63}
{48C29501-3FA2-46A7-B5BA-D282EA8F1274} = {2097345F-4DD3-477D-BC54-A922F9B2B402}
{C42868C8-968A-473F-AC39-AC97C5D47E84} = {2097345F-4DD3-477D-BC54-A922F9B2B402}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Contrib.Instrumentation.AWS/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Raised the minimum .NET version to `net462`
([#1095](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1095))

## 1.0.2

Released 2022-Nov-11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
<TargetFrameworks>netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>AWS client instrumentation for OpenTelemetry .NET</Description>
<MinVerTagPrefix>Instrumentation.AWS-</MinVerTagPrefix>
<Nullable>enable</Nullable>
Expand Down
21 changes: 21 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

## Unreleased

* Fix a bug where metrics without exemplars were not getting exported.
([#1099](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1099))

* Relaxed table name mapping validation rules to restore the previous behavior
from version 1.3.0.
([#1109](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/1109))

* Add support for exporting metrics to more than a single account/namespace
combination using a single GenevaMetricExporter instance. Users can now export
individual metric streams to:
* An account of their choice by adding the dimension
`_microsoft_metrics_account` and providing a `string` value for it as the
account name.
* A metric namespace of their choice by adding the dimension
`_microsoft_metrics_namespace` and providing a `string` value for it as the
namespace name.
([#1111](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1111))

* Fix a bug in TldTraceExporter for incorrect serialization of special tags.
([#1115](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1115))

## 1.5.0-alpha.1

Released 2023-Mar-13
Expand Down
3 changes: 2 additions & 1 deletion src/OpenTelemetry.Exporter.Geneva/GenevaExporterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public IReadOnlyDictionary<string, string> TableNameMappings
throw new ArgumentException($"The table name mapping value '{entry.Value}' provided for key '{entry.Key}' contained non-ASCII characters.", nameof(this.TableNameMappings));
}

/* Note: Validation disabled because it broke previously released versions.
if (entry.Value != "*")
{
if (!TableNameSerializer.IsValidTableName(entry.Value))
Expand All @@ -73,7 +74,7 @@ public IReadOnlyDictionary<string, string> TableNameMappings
{
throw new ArgumentException($"The table name mapping value '{entry.Value}' provided for key '{entry.Key}' is reserved and cannot be specified.", nameof(this.TableNameMappings));
}
}
}*/

copy[entry.Key] = entry.Value;
}
Expand Down
40 changes: 0 additions & 40 deletions src/OpenTelemetry.Exporter.Geneva/Internal/TableNameSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public TableNameSerializer(GenevaExporterOptions options, string defaultTableNam
{
Debug.Assert(options != null, "options were null");
Debug.Assert(!string.IsNullOrWhiteSpace(defaultTableName), "defaultEventName was null or whitespace");
Debug.Assert(IsValidTableName(defaultTableName), "defaultEventName was invalid");

this.m_defaultTableName = BuildStr8BufferForAsciiString(defaultTableName);

Expand Down Expand Up @@ -83,45 +82,6 @@ public TableNameSerializer(GenevaExporterOptions options, string defaultTableNam
}
}

public static bool IsReservedTableName(string tableName)
{
Debug.Assert(!string.IsNullOrWhiteSpace(tableName), "tableName was null or whitespace");

// TODO: Implement this if needed.

return false;
}

public static bool IsValidTableName(string tableName)
{
Debug.Assert(!string.IsNullOrWhiteSpace(tableName), "tableName was null or whitespace");

var length = tableName.Length;
if (length > MaxSanitizedCategoryNameLength)
{
return false;
}

char firstChar = tableName[0];
if (firstChar < 'A' || firstChar > 'Z')
{
return false;
}

for (int i = 1; i < length; i++)
{
char cur = tableName[i];
if ((cur >= 'a' && cur <= 'z') || (cur >= 'A' && cur <= 'Z') || (cur >= '0' && cur <= '9'))
{
continue;
}

return false;
}

return true;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int ResolveAndSerializeTableNameForCategoryName(byte[] destination, int offset, string categoryName, out ReadOnlySpan<byte> tableName)
{
Expand Down
Loading

0 comments on commit 5ce87e1

Please sign in to comment.