Skip to content

Commit

Permalink
re-adding removed trace attribute values (open-telemetry#1368)
Browse files Browse the repository at this point in the history
the MESSAGING_OPERATION_* attribute values were removed in semconv 1.26.0,
so update our generation to put them back, marking as deprecated
  • Loading branch information
brettmc authored Aug 28, 2024
1 parent 653e453 commit 4fc1700
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions script/semantic-conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Use this output as a basis for updating the relevant deprecations file and gener
Note that some previously-removed semconv entries have been added back in recent versions, so may need to be removed from the
deprecations partials.

NB should also check `TraceAttributeValues` and `ResourceAttributeValues`, since those can also change.

## Add to SemConv/Version

Add an entry to `src/SemConv/Version.php` for the new version.
Expand Down
2 changes: 2 additions & 0 deletions script/semantic-conventions/templates/AttributeValues.php.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ interface {{ class }}AttributeValues
{%- endif -%}
{% if not loop.last %}{# blank line #}{% endif %}
{%- endfor -%}
{# add our own deprecations for moved/removed values, so we don't break things #}
{% include class|lower + "_values_deprecations.php.partial" ignore missing without context %}
}
{# blank line #}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @deprecated Use `messaging.operation.type.publish`
*/
public const MESSAGING_OPERATION_PUBLISH = 'publish';

/**
* @deprecated Use `messaging.operation.type.create`
*/
public const MESSAGING_OPERATION_CREATE = 'create';

/**
* @deprecated Use `messaging.operation.type.receive`
*/
public const MESSAGING_OPERATION_RECEIVE = 'receive';

/**
* @deprecated Use `messaging.operation.type.deliver`
*/
public const MESSAGING_OPERATION_DELIVER = 'process';

/**
* @deprecated Use `messaging.operation.type.settle`
*/
public const MESSAGING_OPERATION_SETTLE = 'settle';
1 change: 1 addition & 0 deletions src/SemConv/ResourceAttributeValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,4 +487,5 @@ interface ResourceAttributeValues
* @see ResourceAttributes::TELEMETRY_SDK_LANGUAGE
*/
public const TELEMETRY_SDK_LANGUAGE_WEBJS = 'webjs';

}
25 changes: 25 additions & 0 deletions src/SemConv/TraceAttributeValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -3144,4 +3144,29 @@ interface TraceAttributeValues
* @see TraceAttributes::VCS_REPOSITORY_REF_TYPE
*/
public const VCS_REPOSITORY_REF_TYPE_TAG = 'tag';

/**
* @deprecated Use `messaging.operation.type.publish`
*/
public const MESSAGING_OPERATION_PUBLISH = 'publish';

/**
* @deprecated Use `messaging.operation.type.create`
*/
public const MESSAGING_OPERATION_CREATE = 'create';

/**
* @deprecated Use `messaging.operation.type.receive`
*/
public const MESSAGING_OPERATION_RECEIVE = 'receive';

/**
* @deprecated Use `messaging.operation.type.deliver`
*/
public const MESSAGING_OPERATION_DELIVER = 'process';

/**
* @deprecated Use `messaging.operation.type.settle`
*/
public const MESSAGING_OPERATION_SETTLE = 'settle';
}

0 comments on commit 4fc1700

Please sign in to comment.