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(eap-rpc): Add an uptime check resolver #6805

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

phacops
Copy link
Contributor

@phacops phacops commented Jan 22, 2025

This will add a resolver to support the uptime check item type.

@phacops phacops requested a review from JoshFerge January 22, 2025 22:30
@phacops phacops requested review from a team as code owners January 22, 2025 22:30
)


def _convert_result_timeseries(
Copy link
Member

Choose a reason for hiding this comment

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

I think this function we could definitely move to the higher level common module

Comment on lines +181 to +207
# buckets time by granularity according to the start time of the request.
# time_slot = start_time + (((timestamp - start_time) // granularity) * granularity)
# Example:
# start_time = 1001
# end_time = 1901
# granularity = 300
# timestamps = [1201, 1002, 1302, 1400, 1700]
# buckets = [1001, 1301, 1601] # end time not included because it would be filtered out by the request
SelectedExpression(
name="time",
expression=f.toDateTime(
f.plus(
request.meta.start_timestamp.seconds,
f.multiply(
f.intDiv(
f.minus(
f.toUnixTimestamp(column("timestamp")),
request.meta.start_timestamp.seconds,
),
request.granularity_secs,
),
request.granularity_secs,
),
),
alias="time_slot",
),
),
Copy link
Member

Choose a reason for hiding this comment

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

because you have this you don't need the time series processor

Copy link
Member

Choose a reason for hiding this comment

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

also a good candidate for a common module


@pytest.mark.clickhouse_db
@pytest.mark.redis_db
class TestTraceItemTable(BaseApiTest):
Copy link
Member

Choose a reason for hiding this comment

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

write a timeseries test as well?

Copy link

codecov bot commented Jan 23, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
906 1 905 8
View the top 1 failed tests by shortest run time
tests.datasets.test_entity_factory::test_all_names
Stack Traces | 1.62s run time
Traceback (most recent call last):
  File ".../tests/datasets/test_entity_factory.py", line 77, in test_all_names
    assert set(get_all_entity_names()) == set(ENTITY_KEYS)
AssertionError: assert {EntityKey.TRANSACTIONS,\n EntityKey.FUNCTIONS,\n EntityKey.UPTIME_CHECKS,\n EntityKey.GROUP_ATTRIBUTES,\n EntityKey.OUTCOMES,\n EntityKey.GROUPEDMESSAGE,\n EntityKey.EVENTS,\n EntityKey.GROUPASSIGNEE,\n EntityKey.GENERIC_METRICS_COUNTERS_META,\n EntityKey.METRICS_SETS,\n EntityKey.GENERIC_METRICS_GAUGES,\n EntityKey.GENERIC_METRICS_DISTRIBUTIONS_META_TAG_VALUES,\n EntityKey.DISCOVER_TRANSACTIONS,\n EntityKey.GENERIC_METRICS_DISTRIBUTIONS,\n EntityKey.__INTERNAL_GENERIC_ORG_METRICS_DISTRIBUTIONS,\n EntityKey.DISCOVER_EVENTS,\n EntityKey.__INTERNAL_ORG_METRICS_DISTRIBUTIONS,\n EntityKey.ORG_METRICS_COUNTERS,\n EntityKey.METRICS_COUNTERS,\n EntityKey.__INTERNAL_ORG_METRICS_SETS,\n EntityKey.GENERIC_METRICS_GAUGES_META,\n EntityKey.SPANS_NUM_ATTRS,\n EntityKey.EAP_SPANS,\n EntityKey.SPANS,\n EntityKey.PROFILES,\n EntityKey.DISCOVER,\n EntityKey.SEARCH_ISSUES,\n EntityKey.SPANS_STR_ATTRS,\n EntityKey.REPLAYS,\n EntityKey.REPLAYS_AGGREGATED,\n EntityKey.GENERIC_METRICS_SETS_META,\n EntityKey.OURLOGS,\n EntityKey.GENERIC_ORG_METRICS_COUNTERS,\n EntityKey.GENERIC_METRICS_SETS,\n EntityKey.OUTCOMES_RAW,\n EntityKey.METRICS_DISTRIBUTIONS,\n EntityKey.GENERIC_METRICS_SETS_META_TAG_VALUES,\n EntityKey.GENERIC_METRICS_COUNTERS_META_TAG_VALUES,\n EntityKey.__INTERNAL_GENERIC_ORG_METRICS_SETS,\n EntityKey.GENERIC_METRICS_DISTRIBUTIONS_META,\n EntityKey.GENERIC_METRICS_COUNTERS,\n EntityKey.GENERIC_METRICS_GAUGES_META_TAG_VALUES} == {EntityKey.SPANS_STR_ATTRS,\n EntityKey.SPANS_NUM_ATTRS,\n EntityKey.EAP_SPANS,\n EntityKey.GENERIC_METRICS_COUNTERS,\n EntityKey.EVENTS,\n EntityKey.DISCOVER,\n EntityKey.OUTCOMES_RAW,\n EntityKey.__INTERNAL_GENERIC_ORG_METRICS_DISTRIBUTIONS,\n EntityKey.SEARCH_ISSUES,\n EntityKey.REPLAYS,\n EntityKey.GENERIC_METRICS_DISTRIBUTIONS_META_TAG_VALUES,\n EntityKey.GENERIC_METRICS_COUNTERS_META,\n EntityKey.METRICS_SETS,\n EntityKey.METRICS_DISTRIBUTIONS,\n EntityKey.ORG_METRICS_COUNTERS,\n EntityKey.GENERIC_METRICS_SETS_META,\n EntityKey.SPANS,\n EntityKey.FUNCTIONS,\n EntityKey.PROFILES,\n EntityKey.__INTERNAL_ORG_METRICS_SETS,\n EntityKey.TRANSACTIONS,\n EntityKey.DISCOVER_EVENTS,\n EntityKey.GENERIC_METRICS_COUNTERS_META_TAG_VALUES,\n EntityKey.DISCOVER_TRANSACTIONS,\n EntityKey.GENERIC_METRICS_SETS,\n EntityKey.GENERIC_METRICS_GAUGES_META_TAG_VALUES,\n EntityKey.REPLAYS_AGGREGATED,\n EntityKey.METRICS_COUNTERS,\n EntityKey.GENERIC_ORG_METRICS_COUNTERS,\n EntityKey.GENERIC_METRICS_GAUGES_META,\n EntityKey.GENERIC_METRICS_DISTRIBUTIONS,\n EntityKey.GENERIC_METRICS_SETS_META_TAG_VALUES,\n EntityKey.__INTERNAL_ORG_METRICS_DISTRIBUTIONS,\n EntityKey.GROUP_ATTRIBUTES,\n EntityKey.__INTERNAL_GENERIC_ORG_METRICS_SETS,\n EntityKey.GENERIC_METRICS_GAUGES,\n EntityKey.OURLOGS,\n EntityKey.GROUPEDMESSAGE,\n EntityKey.GROUPASSIGNEE,\n EntityKey.OUTCOMES,\n EntityKey.GENERIC_METRICS_DISTRIBUTIONS_META}
  Extra items in the left set:
  EntityKey.UPTIME_CHECKS
  Full diff:
    {
  -  EntityKey.SPANS_STR_ATTRS,
  +  EntityKey.TRANSACTIONS,
  +  EntityKey.FUNCTIONS,
  +  EntityKey.UPTIME_CHECKS,
  +  EntityKey.GROUP_ATTRIBUTES,
  +  EntityKey.OUTCOMES,
  +  EntityKey.GROUPEDMESSAGE,
  +  EntityKey.EVENTS,
  +  EntityKey.GROUPASSIGNEE,
  +  EntityKey.GENERIC_METRICS_COUNTERS_META,
  +  EntityKey.METRICS_SETS,
  +  EntityKey.GENERIC_METRICS_GAUGES,
  +  EntityKey.GENERIC_METRICS_DISTRIBUTIONS_META_TAG_VALUES,
  +  EntityKey.DISCOVER_TRANSACTIONS,
  +  EntityKey.GENERIC_METRICS_DISTRIBUTIONS,
  +  EntityKey.__INTERNAL_GENERIC_ORG_METRICS_DISTRIBUTIONS,
  +  EntityKey.DISCOVER_EVENTS,
  +  EntityKey.__INTERNAL_ORG_METRICS_DISTRIBUTIONS,
  +  EntityKey.ORG_METRICS_COUNTERS,
  +  EntityKey.METRICS_COUNTERS,
  +  EntityKey.__INTERNAL_ORG_METRICS_SETS,
  +  EntityKey.GENERIC_METRICS_GAUGES_META,
     EntityKey.SPANS_NUM_ATTRS,
     EntityKey.EAP_SPANS,
  +  EntityKey.SPANS,
  +  EntityKey.PROFILES,
  +  EntityKey.DISCOVER,
  +  EntityKey.SEARCH_ISSUES,
  +  EntityKey.SPANS_STR_ATTRS,
  +  EntityKey.REPLAYS,
  +  EntityKey.REPLAYS_AGGREGATED,
  +  EntityKey.GENERIC_METRICS_SETS_META,
  +  EntityKey.OURLOGS,
  +  EntityKey.GENERIC_ORG_METRICS_COUNTERS,
  +  EntityKey.GENERIC_METRICS_SETS,
  +  EntityKey.OUTCOMES_RAW,
  +  EntityKey.METRICS_DISTRIBUTIONS,
  +  EntityKey.GENERIC_METRICS_SETS_META_TAG_VALUES,
  +  EntityKey.GENERIC_METRICS_COUNTERS_META_TAG_VALUES,
  +  EntityKey.__INTERNAL_GENERIC_ORG_METRICS_SETS,
  +  EntityKey.GENERIC_METRICS_DISTRIBUTIONS_META,
     EntityKey.GENERIC_METRICS_COUNTERS,
  -  EntityKey.EVENTS,
  -  EntityKey.DISCOVER,
  -  EntityKey.OUTCOMES_RAW,
  -  EntityKey.__INTERNAL_GENERIC_ORG_METRICS_DISTRIBUTIONS,
  -  EntityKey.SEARCH_ISSUES,
  -  EntityKey.REPLAYS,
  -  EntityKey.GENERIC_METRICS_DISTRIBUTIONS_META_TAG_VALUES,
  -  EntityKey.GENERIC_METRICS_COUNTERS_META,
  -  EntityKey.METRICS_SETS,
  -  EntityKey.METRICS_DISTRIBUTIONS,
  -  EntityKey.ORG_METRICS_COUNTERS,
  -  EntityKey.GENERIC_METRICS_SETS_META,
  -  EntityKey.SPANS,
  -  EntityKey.FUNCTIONS,
  -  EntityKey.PROFILES,
  -  EntityKey.__INTERNAL_ORG_METRICS_SETS,
  -  EntityKey.TRANSACTIONS,
  -  EntityKey.DISCOVER_EVENTS,
  -  EntityKey.GENERIC_METRICS_COUNTERS_META_TAG_VALUES,
  -  EntityKey.DISCOVER_TRANSACTIONS,
  -  EntityKey.GENERIC_METRICS_SETS,
     EntityKey.GENERIC_METRICS_GAUGES_META_TAG_VALUES,
  -  EntityKey.REPLAYS_AGGREGATED,
  -  EntityKey.METRICS_COUNTERS,
  -  EntityKey.GENERIC_ORG_METRICS_COUNTERS,
  -  EntityKey.GENERIC_METRICS_GAUGES_META,
  -  EntityKey.GENERIC_METRICS_DISTRIBUTIONS,
  -  EntityKey.GENERIC_METRICS_SETS_META_TAG_VALUES,
  -  EntityKey.__INTERNAL_ORG_METRICS_DISTRIBUTIONS,
  -  EntityKey.GROUP_ATTRIBUTES,
  -  EntityKey.__INTERNAL_GENERIC_ORG_METRICS_SETS,
  -  EntityKey.GENERIC_METRICS_GAUGES,
  -  EntityKey.OURLOGS,
  -  EntityKey.GROUPEDMESSAGE,
  -  EntityKey.GROUPASSIGNEE,
  -  EntityKey.OUTCOMES,
  -  EntityKey.GENERIC_METRICS_DISTRIBUTIONS_META,
    }

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

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.

3 participants