Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/sentry/sentry_metrics/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def initialize_subprocess_state(config: MetricsIngestConfiguration) -> None:
"""

sentry_sdk.set_tag("sentry_metrics.use_case_key", config.use_case_id.value)
sentry_sdk.set_attribute("sentry_metrics.use_case_key", config.use_case_id.value)


def initialize_main_process_state(config: MetricsIngestConfiguration) -> None:
Expand All @@ -164,6 +165,7 @@ def initialize_main_process_state(config: MetricsIngestConfiguration) -> None:
"""

sentry_sdk.set_tag("sentry_metrics.use_case_key", config.use_case_id.value)
sentry_sdk.set_attribute("sentry_metrics.use_case_key", config.use_case_id.value)

from sentry.utils.metrics import add_global_tags

Expand Down
4 changes: 3 additions & 1 deletion src/sentry/sentry_metrics/consumers/indexer/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from sentry.sentry_metrics.indexer.base import Metadata
from sentry.sentry_metrics.use_case_id_registry import UseCaseID
from sentry.snuba.metrics.naming_layer.mri import extract_use_case_id
from sentry.utils import metrics
from sentry.utils import json, metrics

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -237,6 +237,7 @@ def _validate_message(self, parsed_payload: ParsedMessage) -> None:
if self.tags_validator(tags) is False:
# sentry doesn't seem to actually capture nested logger.error extra args
sentry_sdk.set_extra("all_metric_tags", tags)
sentry_sdk.set_attribute("all_metric_tags", json.dumps(tags))
logger.error(
"process_messages.invalid_tags",
extra={
Expand Down Expand Up @@ -314,6 +315,7 @@ def reconstruct_messages(
use_case_id = old_payload_value["use_case_id"]
cogs_usage[use_case_id] += 1
sentry_sdk.set_tag("sentry_metrics.organization_id", org_id)
sentry_sdk.set_attribute("sentry_metrics.organization_id", org_id)
tags = old_payload_value.get("tags", {})
used_tags.add(metric_name)

Expand Down
1 change: 1 addition & 0 deletions src/sentry/services/eventstore/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def bind_nodes(self, object_list: Sequence[Event]) -> None:
fetched on any attempt to access a property.
"""
sentry_sdk.set_tag("eventstore.backend", "nodestore")
sentry_sdk.set_attribute("eventstore.backend", "nodestore")

with sentry_sdk.start_span(op="eventstore.base.bind_nodes"):
object_node_list = [(i, i.data) for i in object_list if i.data.id]
Expand Down
1 change: 1 addition & 0 deletions src/sentry/services/eventstore/snuba/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ def get_event_by_id(

if group_id is not None:
sentry_sdk.set_tag("nodestore.event_type", event.get_event_type())
sentry_sdk.set_attribute("nodestore.event_type", event.get_event_type())

if group_id is not None and (
event.get_event_type() == "error"
Expand Down
5 changes: 5 additions & 0 deletions src/sentry/snuba/rpc_dataset_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ def get_table_rpc_request(cls, query: TableQuery) -> TableRequest:
"""Make the query"""
resolver = query.resolver
sentry_sdk.set_tag("query.sampling_mode", query.sampling_mode)
if query.sampling_mode is not None:
sentry_sdk.set_attribute("query.sampling_mode", query.sampling_mode)
meta = resolver.resolve_meta(
referrer=query.referrer,
sampling_mode=query.sampling_mode,
Expand Down Expand Up @@ -413,6 +415,9 @@ def _run_table_query(
sentry_sdk.set_tag(
"query.storage_meta.tier", rpc_response.meta.downsampled_storage_meta.tier
)
sentry_sdk.set_attribute(
"query.storage_meta.tier", rpc_response.meta.downsampled_storage_meta.tier
)

return cls.process_table_response(
rpc_response, table_request, debug=debug, context=cls.build_rpc_table_row_context(query)
Expand Down
2 changes: 2 additions & 0 deletions src/sentry/tsdb/redissnuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def method(self, *a, **kw):
backend = selector_func(key, callargs, self.switchover_timestamp)

sentry_sdk.set_tag("tsdb.backend", backend)
sentry_sdk.set_attribute("tsdb.backend", backend)
sentry_sdk.set_tag("tsdb.method", key)
sentry_sdk.set_attribute("tsdb.method", key)

return getattr(self.backends[backend], key)(*a, **kw)

Expand Down
Loading