Skip to content

Commit

Permalink
Merge branch 'main' into metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas committed Jun 17, 2021
2 parents 8492de6 + 7723fa0 commit ed3322c
Show file tree
Hide file tree
Showing 9 changed files with 379 additions and 175 deletions.
2 changes: 1 addition & 1 deletion build/Common.nonprod.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<MicrosoftExtensionsLoggingPkgVer>[5.0.0,6.0)</MicrosoftExtensionsLoggingPkgVer>
<MicrosoftExtensionsLoggingAbstractionsPkgVer>[5.0.0,6.0)</MicrosoftExtensionsLoggingAbstractionsPkgVer>
<MicrosoftExtensionsLoggingConsolePkgVer>[5.0.0,6.0)</MicrosoftExtensionsLoggingConsolePkgVer>
<MicrosoftNETTestSdkPkgVer>[16.9.1]</MicrosoftNETTestSdkPkgVer>
<MicrosoftNETTestSdkPkgVer>[16.10.0]</MicrosoftNETTestSdkPkgVer>
<MoqPkgVer>[4.14.5,5.0)</MoqPkgVer>
<RabbitMQClientPkgVer>[6.1.0,7.0)</RabbitMQClientPkgVer>
<StackExchangeRedisPkgVer>[2.1.58,3.0)</StackExchangeRedisPkgVer>
Expand Down
3 changes: 2 additions & 1 deletion build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<MicrosoftAspNetCoreHttpFeaturesPkgVer>[2.1.1,6.0)</MicrosoftAspNetCoreHttpFeaturesPkgVer>
<MicrosoftAspNetTelemetryCorrelationPkgVer>[1.0.7,2.0)</MicrosoftAspNetTelemetryCorrelationPkgVer>
<MicrosoftCodeAnalysisAnalyzersPkgVer>[3.3.1]</MicrosoftCodeAnalysisAnalyzersPkgVer>
<MicrosoftCodeCoveragePkgVer>[16.9.1]</MicrosoftCodeCoveragePkgVer>
<MicrosoftCodeCoveragePkgVer>[16.10.0]</MicrosoftCodeCoveragePkgVer>
<MicrosoftExtensionsHostingAbstractionsPkgVer>[2.1.0,6.0)</MicrosoftExtensionsHostingAbstractionsPkgVer>
<MicrosoftExtensionsLoggingPkgVer>[2.1.0,6.0)</MicrosoftExtensionsLoggingPkgVer>
<MicrosoftExtensionsLoggingConfigurationPkgVer>[2.1.0,6.0)</MicrosoftExtensionsLoggingConfigurationPkgVer>
Expand All @@ -57,6 +57,7 @@
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersPkgVer)" Condition="'$(SkipAnalysis)'!='true'">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<!--When updating the Microsoft.CodeCoverage package, update the version number in .\build\process-codecoverage.ps1 as well-->
<PackageReference Include="Microsoft.CodeCoverage" Version="$(MicrosoftCodeCoveragePkgVer)" Condition="'$(Configuration)'=='Release'"/>
<!--<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="$(MicrosoftCodeAnalysisAnalyzersPkgVer)" Condition="'$(SkipAnalysis)'!='true'">
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion build/process-codecoverage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Write-Host $env:USERPROFILE
foreach ($file in $files)
{
$command = $env:USERPROFILE+ '\.nuget\packages\microsoft.codecoverage\16.9.1\build\netstandard1.0\CodeCoverage\CodeCoverage.exe analyze /output:' + $file.DirectoryName + '\' + $file.Name + '.xml '+ $file.FullName
$command = $env:USERPROFILE+ '\.nuget\packages\microsoft.codecoverage\16.10.0\build\netstandard1.0\CodeCoverage\CodeCoverage.exe analyze /output:' + $file.DirectoryName + '\' + $file.Name + '.xml '+ $file.FullName
Write-Host $command
Invoke-Expression $command
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ option java_outer_classname = "TraceServiceProto";
option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/collector/trace/v1";

// Service that can be used to push spans between one Application instrumented with
// OpenTelemetry and an collector, or between an collector and a central collector (in this
// OpenTelemetry and a collector, or between a collector and a central collector (in this
// case spans are sent/received to/from multiple Applications).
service TraceService {
// For performance reasons, it is recommended to keep this RPC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ message AnyValue {
double double_value = 4;
ArrayValue array_value = 5;
KeyValueList kvlist_value = 6;
bytes bytes_value = 7;
}
}

Expand Down Expand Up @@ -65,6 +66,8 @@ message KeyValue {
// StringKeyValue is a pair of key/value strings. This is the simpler (and faster) version
// of KeyValue that only supports string values.
message StringKeyValue {
option deprecated = true;

string key = 1;
string value = 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ message ResourceLogs {

// A list of InstrumentationLibraryLogs that originate from a resource.
repeated InstrumentationLibraryLogs instrumentation_library_logs = 2;

// This schema_url applies to the data in the "resource" field. It does not apply
// to the data in the "instrumentation_library_logs" field which have their own
// schema_url field.
string schema_url = 3;
}

// A collection of Logs produced by an InstrumentationLibrary.
Expand All @@ -43,6 +48,9 @@ message InstrumentationLibraryLogs {

// A list of log records.
repeated LogRecord logs = 2;

// This schema_url applies to all logs in the "logs" field.
string schema_url = 3;
}

// Possible values for LogRecord.SeverityNumber.
Expand Down Expand Up @@ -82,7 +90,7 @@ enum LogRecordFlags {
}

// A log record according to OpenTelemetry Log Data Model:
// https://github.com/open-telemetry/oteps/blob/master/text/logs/0097-log-data-model.md
// https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md
message LogRecord {
// time_unix_nano is the time when the event occurred.
// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// Copyright 2019, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package opentelemetry.proto.metrics.experimental;

import "opentelemetry/proto/resource/v1/resource.proto";

option java_multiple_files = true;
option java_package = "io.opentelemetry.proto.metrics.experimental";
option java_outer_classname = "MetricConfigServiceProto";
option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/metrics/experimental";

// MetricConfig is a service that enables updating metric schedules, trace
// parameters, and other configurations on the SDK without having to restart the
// instrumented application. The collector can also serve as the configuration
// service, acting as a bridge between third-party configuration services and
// the SDK, piping updated configs from a third-party source to an instrumented
// application.
service MetricConfig {
rpc GetMetricConfig (MetricConfigRequest) returns (MetricConfigResponse);
}

message MetricConfigRequest{

// Required. The resource for which configuration should be returned.
opentelemetry.proto.resource.v1.Resource resource = 1;

// Optional. The value of MetricConfigResponse.fingerprint for the last
// configuration that the caller received and successfully applied.
bytes last_known_fingerprint = 2;
}

message MetricConfigResponse {

// Optional. The fingerprint associated with this MetricConfigResponse. Each
// change in configs yields a different fingerprint. The resource SHOULD copy
// this value to MetricConfigRequest.last_known_fingerprint for the next
// configuration request. If there are no changes between fingerprint and
// MetricConfigRequest.last_known_fingerprint, then all other fields besides
// fingerprint in the response are optional, or the same as the last update if
// present.
//
// The exact mechanics of generating the fingerprint is up to the
// implementation. However, a fingerprint must be deterministically determined
// by the configurations -- the same configuration will generate the same
// fingerprint on any instance of an implementation. Hence using a timestamp is
// unacceptable, but a deterministic hash is fine.
bytes fingerprint = 1;

// A Schedule is used to apply a particular scheduling configuration to
// a metric. If a metric name matches a schedule's patterns, then the metric
// adopts the configuration specified by the schedule.
message Schedule {

// A light-weight pattern that can match 1 or more
// metrics, for which this schedule will apply. The string is used to
// match against metric names. It should not exceed 100k characters.
message Pattern {
oneof match {
string equal_to = 1; // matches the metric name exactly
string starts_with = 2; // prefix-matches the metric name
}
}

// Metrics with names that match a rule in the inclusion_patterns are
// targeted by this schedule. Metrics that match the exclusion_patterns
// are not targeted for this schedule, even if they match an inclusion
// pattern.
repeated Pattern exclusion_patterns = 1;
repeated Pattern inclusion_patterns = 2;

// Describes the collection period for each metric in seconds.
// A period of 0 means to not export.
int32 period_sec = 3;
}

// A single metric may match multiple schedules. In such cases, the schedule
// that specifies the smallest period is applied.
//
// Note, for optimization purposes, it is recommended to use as few schedules
// as possible to capture all required metric updates. Where you can be
// conservative, do take full advantage of the inclusion/exclusion patterns to
// capture as much of your targeted metrics.
repeated Schedule schedules = 2;

// Optional. The client is suggested to wait this long (in seconds) before
// pinging the configuration service again.
int32 suggested_wait_time_sec = 3;
}
Loading

0 comments on commit ed3322c

Please sign in to comment.