Skip to content

Commit

Permalink
Remove prefix in yaml, add policy check to block future usages (and m…
Browse files Browse the repository at this point in the history
…inor cleanups) (#1293)

Co-authored-by: Alexandra Konrad <[email protected]>
  • Loading branch information
lmolkova and trisch-me committed Aug 1, 2024
1 parent 69b0744 commit a3cf57f
Show file tree
Hide file tree
Showing 106 changed files with 542 additions and 740 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,5 @@ check-policies:
otel/weaver:${WEAVER_VERSION} registry check \
--registry=/source \
--policy=/policies/registry.rego \
--policy=/policies/attribute_name_collisions.rego
--policy=/policies/attribute_name_collisions.rego \
--policy=/policies/yaml_schema.rego
8 changes: 0 additions & 8 deletions docs/attributes-registry/gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,10 @@

# GCP

- [GCP Attributes](#gcp-attributes)
- [GCP Client Attributes](#gcp-client-attributes)
- [GCP - Google Cloud Run Attributes](#gcp---google-cloud-run-attributes)
- [GCP - Google Compute Engine (GCE) Attributes](#gcp---google-compute-engine-gce-attributes)

## GCP Attributes

Attributes for Google Cloud

| Attribute | Type | Description | Examples | Stability |
| --------- | ---- | ----------- | -------- | --------- |

## GCP Client Attributes

Attributes for Google Cloud client libraries.
Expand Down
1 change: 0 additions & 1 deletion model/faas-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ groups:
- id: attributes.faas.common
type: attribute_group
brief: "Describes FaaS attributes."
prefix: faas
attributes:
- ref: faas.trigger
- ref: faas.invoked_name
Expand Down
1 change: 0 additions & 1 deletion model/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ groups:
- ref: destination.address
- ref: destination.port
- id: peer
prefix: peer
type: span
brief: "Operations that access some remote service."
attributes:
Expand Down
1 change: 0 additions & 1 deletion model/logs/log-exception.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
groups:
- id: log-exception
type: attribute_group
prefix: exception
brief: >
This document defines attributes for exceptions represented using Log
Records.
Expand Down
2 changes: 0 additions & 2 deletions model/logs/mobile-events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ groups:
# brief: >
# This attribute represents the state the application has transitioned into at the occurrence of the event.
# type:
# allow_custom_values: false
# members:
# - id: active
# value: 'active'
Expand Down Expand Up @@ -57,7 +56,6 @@ groups:
# The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc),
# and from which the `OS identifiers` are derived.
# type:
# allow_custom_values: false
# members:
# - id: created
# value: 'created'
Expand Down
1 change: 0 additions & 1 deletion model/messaging-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ groups:
- id: attributes.messaging.common.minimal
type: attribute_group
brief: "Common cross-signal messaging attributes."
prefix: messaging
attributes:
# TODO: Not adding `messaging.system` to the minimal because of https://github.com/open-telemetry/build-tools/issues/192
- ref: error.type
Expand Down
1 change: 0 additions & 1 deletion model/metrics/go-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ groups:
note: >
Computed from `(/memory/classes/total:bytes - /memory/classes/heap/released:bytes)`.
instrument: updowncounter
prefix: go.memory
unit: "By"
attributes:
- ref: go.memory.type
Expand Down
1 change: 0 additions & 1 deletion model/metrics/jvm-metrics-experimental.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ groups:
- id: attributes.jvm.buffer
type: attribute_group
brief: "Describes JVM buffer metric attributes."
prefix: jvm.buffer
attributes:
- ref: jvm.buffer.pool.name
requirement_level: recommended
Expand Down
2 changes: 0 additions & 2 deletions model/metrics/jvm-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ groups:
- id: attributes.jvm.memory
type: attribute_group
brief: "Describes JVM memory metric attributes."
prefix: jvm.memory
attributes:
- ref: jvm.memory.type
requirement_level: recommended
Expand Down Expand Up @@ -52,7 +51,6 @@ groups:
brief: "Duration of JVM garbage collection actions."
instrument: histogram
unit: "s"
prefix: jvm.gc
attributes:
- ref: jvm.gc.name
requirement_level: recommended
Expand Down
1 change: 0 additions & 1 deletion model/metrics/process-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ groups:
type: metric
metric_name: process.disk.io
stability: experimental
prefix: process.disk
brief: "Disk bytes transferred."
instrument: counter
unit: "By"
Expand Down
2 changes: 0 additions & 2 deletions model/metrics/v8js-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ groups:
instrument: histogram
unit: "s"
stability: experimental
prefix: v8js.gc
attributes:
- ref: v8js.gc.type
requirement_level: required
Expand Down Expand Up @@ -61,7 +60,6 @@ groups:
instrument: updowncounter
unit: "By"
stability: experimental
prefix: v8js.heap.space.physical_size
attributes:
- ref: v8js.heap.space.name
requirement_level: required
Expand Down
2 changes: 0 additions & 2 deletions model/network.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
groups:
- id: network-core
prefix: network
type: attribute_group
brief: >
These attributes may be used for any network related operation.
Expand All @@ -15,7 +14,6 @@ groups:
- ref: network.local.port

- id: network-connection-and-carrier
prefix: network
type: attribute_group
brief: >
These attributes may be used for any network related operation.
Expand Down
3 changes: 1 addition & 2 deletions model/registry/android.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
groups:
- id: registry.android
prefix: android
type: attribute_group
display_name: Android Attributes
brief: >
The Android platform on which the Android application is running.
attributes:
- id: os.api_level
- id: android.os.api_level
type: string
stability: experimental
brief: >
Expand Down
15 changes: 7 additions & 8 deletions model/registry/artifact.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
groups:
- id: registry.artifact
prefix: artifact
type: attribute_group
brief: >
This group describes attributes specific to artifacts. Artifacts are
Expand All @@ -9,7 +8,7 @@ groups:
[SLSA](https://slsa.dev/spec/v1.0/terminology#package-model) package
model.
attributes:
- id: filename
- id: artifact.filename
type: string
stability: experimental
brief: >
Expand All @@ -28,13 +27,13 @@ groups:
"release-1.tar.gz",
"file-name-package.tar.gz",
]
- id: version
- id: artifact.version
type: string
stability: experimental
brief: >
The version of the artifact.
examples: ["v0.1.0", "1.2.1", "122691-build"]
- id: purl
- id: artifact.purl
type: string
stability: experimental
brief: >
Expand All @@ -46,7 +45,7 @@ groups:
"pkg:github/package-url/purl-spec@1209109710924",
"pkg:npm/[email protected]",
]
- id: hash
- id: artifact.hash
type: string
stability: experimental
brief: >
Expand All @@ -64,13 +63,13 @@ groups:
deem necessary.
examples:
["9ff4c52759e2c4ac70b7d517bc7fcdc1cda631ca0045271ddd1b192544f8a3e9"]
- id: attestation.id
- id: artifact.attestation.id
type: string
stability: experimental
brief: >
The id of the build [software attestation](https://slsa.dev/attestation-model).
examples: ["123"]
- id: attestation.filename
- id: artifact.attestation.filename
type: string
stability: experimental
brief: >
Expand All @@ -86,7 +85,7 @@ groups:
"release-1.tar.gz.attestation",
"file-name-package.tar.gz.intoto.json1",
]
- id: attestation.hash
- id: artifact.attestation.hash
type: string
stability: experimental
brief: >
Expand Down
17 changes: 7 additions & 10 deletions model/registry/aspnetcore.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
groups:
- id: registry.aspnetcore
prefix: aspnetcore
type: attribute_group
display_name: ASP.NET Core Attributes
brief: ASP.NET Core attributes
attributes:
- id: rate_limiting.policy
- id: aspnetcore.rate_limiting.policy
type: string
brief: Rate limiting policy name.
stability: stable
examples: ["fixed", "sliding", "token"]
- id: rate_limiting.result
- id: aspnetcore.rate_limiting.result
type:
allow_custom_values: true
members:
- id: acquired
value: 'acquired'
Expand All @@ -34,27 +32,26 @@ groups:
brief: Rate-limiting result, shows whether the lease was acquired or contains a rejection reason
examples: ["acquired", "request_canceled"]
requirement_level: required
- id: routing.is_fallback
- id: aspnetcore.routing.is_fallback
type: boolean
stability: stable
brief: A value that indicates whether the matched route is a fallback route.
examples: [true]
- id: diagnostics.handler.type
- id: aspnetcore.diagnostics.handler.type
type: string
stability: stable
brief: Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
implementation that handled the exception.
examples: ["Contoso.MyHandler"]
requirement_level:
conditionally_required: if and only if the exception was handled by this handler.
- id: request.is_unhandled
- id: aspnetcore.request.is_unhandled
type: boolean
stability: stable
brief: Flag indicating if request was handled by the application pipeline.
examples: [true]
- id: routing.match_status
- id: aspnetcore.routing.match_status
type:
allow_custom_values: true
members:
- id: success
value: 'success'
Expand All @@ -67,7 +64,7 @@ groups:
stability: stable
brief: Match result - success or failure
examples: ["success", "failure"]
- id: diagnostics.exception.result
- id: aspnetcore.diagnostics.exception.result
type:
members:
- id: handled
Expand Down
Loading

0 comments on commit a3cf57f

Please sign in to comment.