Giter Club home page Giter Club logo

Comments (3)

getsantry avatar getsantry commented on August 24, 2024

Assigning to @getsentry/support for routing ⏲️

from sentry.

getsantry avatar getsantry commented on August 24, 2024

Routing to @getsentry/product-owners-settings-integrations for triage ⏲️

from sentry.

cathteng avatar cathteng commented on August 24, 2024

Webhook event data is generated here

def _webhook_event_data(event, group_id, project_id):
project = Project.objects.get_from_cache(id=project_id)
organization = Organization.objects.get_from_cache(id=project.organization_id)
event_context = event.as_dict()
event_context["url"] = absolute_uri(
reverse(
"sentry-api-0-project-event-details",
args=[project.organization.slug, project.slug, event.event_id],
)
)
event_context["web_url"] = absolute_uri(
reverse(
"sentry-organization-event-detail", args=[organization.slug, group_id, event.event_id]
)
)
# The URL has a regex OR in it ("|") which means `reverse` cannot generate
# a valid URL (it can't know which option to pick). We have to manually
# create this URL for, that reason.
event_context["issue_url"] = absolute_uri(f"/api/0/issues/{group_id}/")
event_context["issue_id"] = str(group_id)
return event_context

We call event.as_dict() to get the event information

def as_dict(self) -> Mapping[str, Any]:
"""Returns the data in normalized form for external consumers."""
data: MutableMapping[str, Any] = {}
data["event_id"] = self.event_id
data["project"] = self.project_id
data["release"] = self.release
data["dist"] = self.dist
data["platform"] = self.platform
data["message"] = self.message
data["datetime"] = self.datetime
data["tags"] = [(k.split("sentry:", 1)[-1], v) for (k, v) in self.tags]
for k, v in sorted(self.data.items()):
if k in data:
continue
if k == "sdk":
v = {v_k: v_v for v_k, v_v in v.items() if v_k != "client_ip"}
data[k] = v
# for a long time culprit was not persisted. In those cases put
# the culprit in from the group.
if data.get("culprit") is None and self.group_id and self.group:
data["culprit"] = self.group.culprit
# Override title and location with dynamically generated data
data["title"] = self.title
data["location"] = self.location
return data
, which includes all of the tags.

This fetches tags from Snuba with a fallback on Nodestore

@property
def tags(self) -> Sequence[tuple[str, str]]:
"""
Tags property uses tags from snuba if loaded otherwise falls back to
nodestore.
"""
tags_key_column = self._get_column_name(Columns.TAGS_KEY)
tags_value_column = self._get_column_name(Columns.TAGS_VALUE)
if tags_key_column in self._snuba_data and tags_value_column in self._snuba_data:
keys = self._snuba_data[tags_key_column]
values = self._snuba_data[tags_value_column]
if keys and values and len(keys) == len(values):
return sorted(zip(keys, values))
else:
return []
# Nodestore implementation
try:
rv = sorted(
(t, v)
for t, v in get_path(self.data, "tags", filter=True) or ()
if t is not None and v is not None
)
return rv
except ValueError:
# at one point Sentry allowed invalid tag sets such as (foo, bar)
# vs ((tag, foo), (tag, bar))
return []

If tags are not appearing in the webhook data, that would appear to be some problem with Snuba or Nodestore as the integration does not manipulate (remove) the tags in any way besides formatting them.

from sentry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.