Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(semconv): update semantic conventions to 1.28.0 #5181

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

trentm
Copy link
Contributor

@trentm trentm commented Nov 19, 2024

@trentm trentm self-assigned this Nov 19, 2024
@trentm trentm requested a review from a team as a code owner November 19, 2024 17:37
@trentm
Copy link
Contributor Author

trentm commented Nov 19, 2024

As an overview of the semconv changes, here is the change in just the export ... statements for 1.28.0 (from 1.27.0):

`git diff | rg '^[-+]export'`
% git diff | rg '^[-+]export'
+export const ATTR_AZ_NAMESPACE = 'az.namespace' as const;
+export const ATTR_CLOUDFOUNDRY_APP_ID = 'cloudfoundry.app.id' as const;
+export const ATTR_CLOUDFOUNDRY_APP_INSTANCE_ID = 'cloudfoundry.app.instance.id' as const;
+export const ATTR_CLOUDFOUNDRY_APP_NAME = 'cloudfoundry.app.name' as const;
+export const ATTR_CLOUDFOUNDRY_ORG_ID = 'cloudfoundry.org.id' as const;
+export const ATTR_CLOUDFOUNDRY_ORG_NAME = 'cloudfoundry.org.name' as const;
+export const ATTR_CLOUDFOUNDRY_PROCESS_ID = 'cloudfoundry.process.id' as const;
+export const ATTR_CLOUDFOUNDRY_PROCESS_TYPE = 'cloudfoundry.process.type' as const;
+export const ATTR_CLOUDFOUNDRY_SPACE_ID = 'cloudfoundry.space.id' as const;
+export const ATTR_CLOUDFOUNDRY_SPACE_NAME = 'cloudfoundry.space.name' as const;
+export const ATTR_CLOUDFOUNDRY_SYSTEM_ID = 'cloudfoundry.system.id' as const;
+export const ATTR_CLOUDFOUNDRY_SYSTEM_INSTANCE_ID = 'cloudfoundry.system.instance.id' as const;
+export const ATTR_CONTAINER_CSI_PLUGIN_NAME = 'container.csi.plugin.name' as const;
+export const ATTR_CONTAINER_CSI_VOLUME_ID = 'container.csi.volume.id' as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = "Batch" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = "batch" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_CREATE = "Create" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_CREATE = "create" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_DELETE = "Delete" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_DELETE = "delete" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE = "Execute" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE = "execute" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE_JAVASCRIPT = "ExecuteJavaScript" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE_JAVASCRIPT = "execute_javascript" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD = "Head" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD = "head" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD_FEED = "HeadFeed" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD_FEED = "head_feed" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_INVALID = "Invalid" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_INVALID = "invalid" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_PATCH = "Patch" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_PATCH = "patch" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY = "Query" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY = "query" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY_PLAN = "QueryPlan" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY_PLAN = "query_plan" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_READ = "Read" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_READ = "read" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_READ_FEED = "ReadFeed" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_READ_FEED = "read_feed" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_REPLACE = "Replace" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_REPLACE = "replace" as const;
-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_UPSERT = "Upsert" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_UPSERT = "upsert" as const;
+export const ATTR_DB_RESPONSE_STATUS_CODE = 'db.response.status_code' as const;
+export const ATTR_DOTNET_GC_HEAP_GENERATION = 'dotnet.gc.heap.generation' as const;
+export const DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = "gen0" as const;
+export const DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = "gen1" as const;
+export const DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = "gen2" as const;
+export const DOTNET_GC_HEAP_GENERATION_VALUE_LOH = "loh" as const;
+export const DOTNET_GC_HEAP_GENERATION_VALUE_POH = "poh" as const;
+export const ATTR_FILE_ACCESSED = 'file.accessed' as const;
+export const ATTR_FILE_ATTRIBUTES = 'file.attributes' as const;
+export const ATTR_FILE_CHANGED = 'file.changed' as const;
+export const ATTR_FILE_CREATED = 'file.created' as const;
+export const ATTR_FILE_FORK_NAME = 'file.fork_name' as const;
+export const ATTR_FILE_GROUP_ID = 'file.group.id' as const;
+export const ATTR_FILE_GROUP_NAME = 'file.group.name' as const;
+export const ATTR_FILE_INODE = 'file.inode' as const;
+export const ATTR_FILE_MODE = 'file.mode' as const;
+export const ATTR_FILE_MODIFIED = 'file.modified' as const;
+export const ATTR_FILE_OWNER_ID = 'file.owner.id' as const;
+export const ATTR_FILE_OWNER_NAME = 'file.owner.name' as const;
+export const ATTR_FILE_SYMBOLIC_LINK_TARGET_PATH = 'file.symbolic_link.target_path' as const;
+export const ATTR_GEN_AI_OPENAI_REQUEST_RESPONSE_FORMAT = 'gen_ai.openai.request.response_format' as const;
+export const GEN_AI_OPENAI_REQUEST_RESPONSE_FORMAT_VALUE_JSON_OBJECT = "json_object" as const;
+export const GEN_AI_OPENAI_REQUEST_RESPONSE_FORMAT_VALUE_JSON_SCHEMA = "json_schema" as const;
+export const GEN_AI_OPENAI_REQUEST_RESPONSE_FORMAT_VALUE_TEXT = "text" as const;
+export const ATTR_GEN_AI_OPENAI_REQUEST_SEED = 'gen_ai.openai.request.seed' as const;
+export const ATTR_GEN_AI_OPENAI_REQUEST_SERVICE_TIER = 'gen_ai.openai.request.service_tier' as const;
+export const GEN_AI_OPENAI_REQUEST_SERVICE_TIER_VALUE_AUTO = "auto" as const;
+export const GEN_AI_OPENAI_REQUEST_SERVICE_TIER_VALUE_DEFAULT = "default" as const;
+export const ATTR_GEN_AI_OPENAI_RESPONSE_SERVICE_TIER = 'gen_ai.openai.response.service_tier' as const;
+export const ATTR_HW_ID = 'hw.id' as const;
+export const ATTR_HW_NAME = 'hw.name' as const;
+export const ATTR_HW_PARENT = 'hw.parent' as const;
+export const ATTR_HW_STATE = 'hw.state' as const;
+export const HW_STATE_VALUE_DEGRADED = "degraded" as const;
+export const HW_STATE_VALUE_FAILED = "failed" as const;
+export const HW_STATE_VALUE_OK = "ok" as const;
+export const ATTR_HW_TYPE = 'hw.type' as const;
+export const HW_TYPE_VALUE_BATTERY = "battery" as const;
+export const HW_TYPE_VALUE_CPU = "cpu" as const;
+export const HW_TYPE_VALUE_DISK_CONTROLLER = "disk_controller" as const;
+export const HW_TYPE_VALUE_ENCLOSURE = "enclosure" as const;
+export const HW_TYPE_VALUE_FAN = "fan" as const;
+export const HW_TYPE_VALUE_GPU = "gpu" as const;
+export const HW_TYPE_VALUE_LOGICAL_DISK = "logical_disk" as const;
+export const HW_TYPE_VALUE_MEMORY = "memory" as const;
+export const HW_TYPE_VALUE_NETWORK = "network" as const;
+export const HW_TYPE_VALUE_PHYSICAL_DISK = "physical_disk" as const;
+export const HW_TYPE_VALUE_POWER_SUPPLY = "power_supply" as const;
+export const HW_TYPE_VALUE_TAPE_DRIVE = "tape_drive" as const;
+export const HW_TYPE_VALUE_TEMPERATURE = "temperature" as const;
+export const HW_TYPE_VALUE_VOLTAGE = "voltage" as const;
+export const ATTR_K8S_VOLUME_NAME = 'k8s.volume.name' as const;
+export const ATTR_K8S_VOLUME_TYPE = 'k8s.volume.type' as const;
+export const K8S_VOLUME_TYPE_VALUE_CONFIG_MAP = "configMap" as const;
+export const K8S_VOLUME_TYPE_VALUE_DOWNWARD_API = "downwardAPI" as const;
+export const K8S_VOLUME_TYPE_VALUE_EMPTY_DIR = "emptyDir" as const;
+export const K8S_VOLUME_TYPE_VALUE_LOCAL = "local" as const;
+export const K8S_VOLUME_TYPE_VALUE_PERSISTENT_VOLUME_CLAIM = "persistentVolumeClaim" as const;
+export const K8S_VOLUME_TYPE_VALUE_SECRET = "secret" as const;
+export const MESSAGING_OPERATION_TYPE_VALUE_SEND = "send" as const;
+export const ATTR_NODEJS_EVENTLOOP_STATE = 'nodejs.eventloop.state' as const;
+export const NODEJS_EVENTLOOP_STATE_VALUE_ACTIVE = "active" as const;
+export const NODEJS_EVENTLOOP_STATE_VALUE_IDLE = "idle" as const;
+export const ATTR_PROCESS_ARGS_COUNT = 'process.args_count' as const;
+export const ATTR_PROCESS_EXECUTABLE_BUILD_ID_GNU = 'process.executable.build_id.gnu' as const;
+export const ATTR_PROCESS_EXECUTABLE_BUILD_ID_GO = 'process.executable.build_id.go' as const;
+export const ATTR_PROCESS_EXECUTABLE_BUILD_ID_PROFILING = 'process.executable.build_id.profiling' as const;
+export const ATTR_PROCESS_TITLE = 'process.title' as const;
+export const ATTR_PROCESS_WORKING_DIRECTORY = 'process.working_directory' as const;
+export const ATTR_PROFILE_FRAME_TYPE = 'profile.frame.type' as const;
+export const PROFILE_FRAME_TYPE_VALUE_CPYTHON = "cpython" as const;
+export const PROFILE_FRAME_TYPE_VALUE_DOTNET = "dotnet" as const;
+export const PROFILE_FRAME_TYPE_VALUE_JVM = "jvm" as const;
+export const PROFILE_FRAME_TYPE_VALUE_KERNEL = "kernel" as const;
+export const PROFILE_FRAME_TYPE_VALUE_NATIVE = "native" as const;
+export const PROFILE_FRAME_TYPE_VALUE_PERL = "perl" as const;
+export const PROFILE_FRAME_TYPE_VALUE_PHP = "php" as const;
+export const PROFILE_FRAME_TYPE_VALUE_RUBY = "ruby" as const;
+export const PROFILE_FRAME_TYPE_VALUE_V8JS = "v8js" as const;
+export const METRIC_CONTAINER_CPU_USAGE = 'container.cpu.usage' as const;
+export const METRIC_DOTNET_ASSEMBLY_COUNT = 'dotnet.assembly.count' as const;
+export const METRIC_DOTNET_EXCEPTIONS = 'dotnet.exceptions' as const;
+export const METRIC_DOTNET_GC_COLLECTIONS = 'dotnet.gc.collections' as const;
+export const METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED = 'dotnet.gc.heap.total_allocated' as const;
+export const METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE = 'dotnet.gc.last_collection.heap.fragmentation.size' as const;
+export const METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE = 'dotnet.gc.last_collection.heap.size' as const;
+export const METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE = 'dotnet.gc.last_collection.memory.committed_size' as const;
+export const METRIC_DOTNET_GC_PAUSE_TIME = 'dotnet.gc.pause.time' as const;
+export const METRIC_DOTNET_JIT_COMPILATION_TIME = 'dotnet.jit.compilation.time' as const;
+export const METRIC_DOTNET_JIT_COMPILED_IL_SIZE = 'dotnet.jit.compiled_il.size' as const;
+export const METRIC_DOTNET_JIT_COMPILED_METHODS = 'dotnet.jit.compiled_methods' as const;
+export const METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS = 'dotnet.monitor.lock_contentions' as const;
+export const METRIC_DOTNET_PROCESS_CPU_COUNT = 'dotnet.process.cpu.count' as const;
+export const METRIC_DOTNET_PROCESS_CPU_TIME = 'dotnet.process.cpu.time' as const;
+export const METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET = 'dotnet.process.memory.working_set' as const;
+export const METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH = 'dotnet.thread_pool.queue.length' as const;
+export const METRIC_DOTNET_THREAD_POOL_THREAD_COUNT = 'dotnet.thread_pool.thread.count' as const;
+export const METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT = 'dotnet.thread_pool.work_item.count' as const;
+export const METRIC_DOTNET_TIMER_COUNT = 'dotnet.timer.count' as const;
+export const METRIC_HW_ENERGY = 'hw.energy' as const;
+export const METRIC_HW_ERRORS = 'hw.errors' as const;
+export const METRIC_HW_POWER = 'hw.power' as const;
+export const METRIC_HW_STATUS = 'hw.status' as const;
+export const METRIC_K8S_NODE_CPU_TIME = 'k8s.node.cpu.time' as const;
+export const METRIC_K8S_NODE_CPU_USAGE = 'k8s.node.cpu.usage' as const;
+export const METRIC_K8S_NODE_MEMORY_USAGE = 'k8s.node.memory.usage' as const;
+export const METRIC_K8S_POD_CPU_TIME = 'k8s.pod.cpu.time' as const;
+export const METRIC_K8S_POD_CPU_USAGE = 'k8s.pod.cpu.usage' as const;
+export const METRIC_K8S_POD_MEMORY_USAGE = 'k8s.pod.memory.usage' as const;
+export const METRIC_MESSAGING_CLIENT_SENT_MESSAGES = 'messaging.client.sent.messages' as const;
+export const METRIC_NODEJS_EVENTLOOP_TIME = 'nodejs.eventloop.time' as const;
+export const METRIC_PROCESS_UPTIME = 'process.uptime' as const;
+export const METRIC_SYSTEM_DISK_LIMIT = 'system.disk.limit' as const;
+export const METRIC_SYSTEM_FILESYSTEM_LIMIT = 'system.filesystem.limit' as const;

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.56%. Comparing base (0ee9a27) to head (cf7e022).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5181      +/-   ##
==========================================
- Coverage   94.57%   94.56%   -0.02%     
==========================================
  Files         314      314              
  Lines        7961     7961              
  Branches     1600     1600              
==========================================
- Hits         7529     7528       -1     
- Misses        432      433       +1     

see 1 file with indirect coverage changes

---- 🚨 Try these New Features:

@dyladan
Copy link
Member

dyladan commented Nov 19, 2024

The changes from your comment don't seem to match the diff. For example you have this change which I can't find in the PR. I was looking into the casing changes to see if they were caused by a change in semconv or a change in how we render semconv

-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = "Batch" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = "batch" as const;

@JamieDanielson
Copy link
Member

The changes from your comment don't seem to match the diff. For example you have this change which I can't find in the PR. I was looking into the casing changes to see if they were caused by a change in semconv or a change in how we render semconv

-export const DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = "Batch" as const;
+export const DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = "batch" as const;

Looks like it's in semantic-conventions/src/experimental_attributes.ts, just hidden because it's a large file and needs to be expanded to show everything.

DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH change

@@ -5,8 +5,10 @@ set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"

# freeze the spec version to make SpanAttributess generation reproducible
SPEC_VERSION=v1.27.0
# Get latest version by running `git tag -l --sort=version:refname | tail -1`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏆 thank you for the note

@JamieDanielson
Copy link
Member

I was looking into the casing changes to see if they were caused by a change in semconv or a change in how we render semconv

It does look like it changed in semconv to explicitly be lowercase. It's unfortunate this doesn't show up in schema changes as I like to use that for a quick reference 🤔

Copy link
Member

@JamieDanielson JamieDanielson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can or should provide more details in the changelog, e.g. the known changes mentioned in the schema (in this case, the rename map of messaging.client.published.messages: messaging.client.sent.messages).

Alternatively we can hold off until new attributes are stabilized and only announce changes then. 🤷 The notes provided in the other semconv PR may be sufficient, as this is expected to have breaking changes.

@trentm
Copy link
Contributor Author

trentm commented Nov 20, 2024

I wonder if we can or should provide more details in the changelog, e.g. the known changes mentioned in the schema (in this case, the rename map of messaging.client.published.messages: messaging.client.sent.messages).

To provide changelog/release-notes on the changes would require us processing the schema file.

We could perhaps link to it and/or the semconv repo's changelog: https://github.com/open-telemetry/semantic-conventions/blob/main/CHANGELOG.md#v1280
That changelog is potentially an overwhelming number of changes. I guess an instrumentation author can limit to just those entries that might apply.

The schema and semconv repo CHANGELOG speak only in terms of the string values.
It would likely be more helpful to users of @opentelemetry/semantic-conventions to have some listing of changes in terms of the exported names.

Alternatively we can hold off until new attributes are stabilized and only announce changes then.

Yah, I suppose we could simplify our work:

  • changes in stable stuff: Here are some notes for you.
  • changes in unstable stuff: Use the source, Luke.

@trentm
Copy link
Contributor Author

trentm commented Nov 20, 2024

A linked to the semconv repo's schema and changelog as a minimal starting point.

@trentm trentm added this pull request to the merge queue Nov 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 20, 2024
@trentm trentm added this pull request to the merge queue Nov 20, 2024
Merged via the queue into open-telemetry:main with commit d8bc6b2 Nov 20, 2024
21 checks passed
@trentm trentm deleted the tm-semconv-1.28.0 branch November 20, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants