0.7.0 格式 - Amazon CloudWatch
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

0.7.0 格式

开放遥测是工具、API 和软件开发工具包的集合。您可以使用它来测量、生成、收集和导出遥测数据(量度、日志和跟踪)以进行分析。开放遥测是云原生计算基金会的一部分。有关更多信息,请参阅 。开放遥测

有关完整开放遥测 0.7.0 规范的信息,请参阅v0.7.0 发行版

注意

虽然度量流已公开发布,但 Open遥测格式 0.7.0 尚未公开发布。即使开放遥测格式 1.0 版可用,度量流也将继续提供开放遥测格式 0.7.0。

Kinesis 记录可以包含一个或多个ExportMetricsServiceRequest开放遥测数据结构。每个数据结构都以一个标头开始UnsignedVarInt32表示记录长度(字节)。EACHExportMetricsServiceRequest可能同时包含来自多个指标的数据。

以下是消息的字符串表示形式ExportMetricsServiceRequest开放遥测数据结构。Open遥测对谷歌协议缓冲区二进制协议的使用进行序列化,这是不可读的。

resource_metrics { resource { attributes { key: "cloud.provider" value { string_value: "aws" } } attributes { key: "cloud.account.id" value { string_value: "2345678901" } } attributes { key: "cloud.region" value { string_value: "us-east-1" } } attributes { key: "aws.exporter.arn" value { string_value: "arn:aws:cloudwatch:us-east-1:123456789012:metric-stream/MyMetricStream" } } } instrumentation_library_metrics { metrics { name: "amazonaws.com/AWS/DynamoDB/ConsumedReadCapacityUnits" unit: "1" double_summary { data_points { labels { key: "Namespace" value: "AWS/DynamoDB" } labels { key: "MetricName" value: "ConsumedReadCapacityUnits" } labels { key: "TableName" value: "MyTable" } start_time_unix_nano: 1604948400000000000 time_unix_nano: 1604948460000000000 count: 1 sum: 1.0 quantile_values { quantile: 0.0 value: 1.0 } quantile_values { quantile: 1.0 value: 1.0 } } data_points { labels { key: "Namespace" value: "AWS/DynamoDB" } labels { key: "MetricName" value: "ConsumedReadCapacityUnits" } labels { key: "TableName" value: "MyTable" } start_time_unix_nano: 1604948460000000000 time_unix_nano: 1604948520000000000 count: 2 sum: 5.0 quantile_values { quantile: 0.0 value: 2.0 } quantile_values { quantile: 1.0 value: 3.0 } } } } } }

用于序列化开放遥测度量数据的顶级对象

ExportMetricsServiceRequest是用于序列化 Open遥测导出器有效负载的顶级包装器。它包含一个或多个ResourceMetrics

message ExportMetricsServiceRequest { // An array of ResourceMetrics. // For data coming from a single resource this array will typically contain one // 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.metrics.v1.ResourceMetrics resource_metrics = 1; }

ResourceMetrics是表示 MetricData 对象的顶级对象。

// A collection of InstrumentationLibraryMetrics from a Resource. message ResourceMetrics { // The resource for the metrics in this message. // If this field is not set then no resource info is known. opentelemetry.proto.resource.v1.Resource resource = 1; // A list of metrics that originate from a resource. repeated InstrumentationLibraryMetrics instrumentation_library_metrics = 2; }

Resource 对象

AResource对象是一个值对对象,其中包含有关生成指标的资源的一些信息。对于由创建的指标Amazon,则数据结构包含与指标相关的资源的 Amazon 资源名称 (ARN),例如 EC2 实例或 S3 存储桶。

这些区域有:Resource对象包含名为attributes,用于存储键值对的列表。

  • cloud.account.id包含账户 ID

  • cloud.region包含区域

  • aws.exporter.arn包含度量流 ARN

  • cloud.provider 始终为 aws

// Resource information. message Resource { // Set of labels that describe the resource. repeated opentelemetry.proto.common.v1.KeyValue attributes = 1; // dropped_attributes_count is the number of dropped attributes. If the value is 0, // no attributes were dropped. uint32 dropped_attributes_count = 2; }

工具库指标对象

不会填充工具库字段。我们将仅填写正在导出的指标字段。

// A collection of Metrics produced by an InstrumentationLibrary. message InstrumentationLibraryMetrics { // The instrumentation library information for the metrics in this message. // If this field is not set then no library info is known. opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; // A list of metrics that originate from an instrumentation library. repeated Metric metrics = 2; }

指标对象

指标对象包含DoubleSummary数据字段,该字段包含DoubleSummaryDataPoint

message Metric { // name of the metric, including its DNS name prefix. It must be unique. string name = 1; // description of the metric, which can be used in documentation. string description = 2; // unit in which the metric value is reported. Follows the format // described by http://unitsofmeasure.org/ucum.html. string unit = 3; oneof data { IntGauge int_gauge = 4; DoubleGauge double_gauge = 5; IntSum int_sum = 6; DoubleSum double_sum = 7; IntHistogram int_histogram = 8; DoubleHistogram double_histogram = 9; DoubleSummary double_summary = 11; } } message DoubleSummary { repeated DoubleSummaryDataPoint data_points = 1; }

指标描述符对象

度量描述符对象包含元数据。有关更多信息,请参阅 。度量。(位于 GitHub 上)。

对于指标流,指标描述符包含以下内容:

双摘要 Data Point 对象

双摘要数据点对象包含双摘要度量中时间序列中单个数据点的值。

// DoubleSummaryDataPoint is a single data point in a timeseries that describes the // time-varying values of a Summary metric. message DoubleSummaryDataPoint { // The set of labels that uniquely identify this timeseries. repeated opentelemetry.proto.common.v1.StringKeyValue labels = 1; // start_time_unix_nano is the last time when the aggregation value was reset // to "zero". For some metric types this is ignored, see data types for more // details. // // The aggregation value is over the time interval (start_time_unix_nano, // time_unix_nano]. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. // // Value of 0 indicates that the timestamp is unspecified. In that case the // timestamp may be decided by the backend. fixed64 start_time_unix_nano = 2; // time_unix_nano is the moment when this aggregation value was reported. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. fixed64 time_unix_nano = 3; // count is the number of values in the population. Must be non-negative. fixed64 count = 4; // sum of the values in the population. If count is zero then this field // must be zero. double sum = 5; // Represents the value at a given quantile of a distribution. // // To record Min and Max values following conventions are used: // - The 1.0 quantile is equivalent to the maximum value observed. // - The 0.0 quantile is equivalent to the minimum value observed. message ValueAtQuantile { // The quantile of a distribution. Must be in the interval // [0.0, 1.0]. double quantile = 1; // The value at the given quantile of a distribution. double value = 2; } // (Optional) list of values at different quantiles of the distribution calculated // from the current snapshot. The quantiles must be strictly increasing. repeated ValueAtQuantile quantile_values = 6; }

有关更多信息,请参阅 使用开放遥测 0.7.0 格式进行翻译