Compare commits

..

6 Commits

Author SHA1 Message Date
makeavish
9fa3dd6c9b fix(empty-state): preserve telemetry stats best effort 2026-06-11 15:16:34 +05:30
makeavish
1488c81380 fix(empty-state): defer infra metrics context 2026-06-11 15:05:06 +05:30
makeavish
1f7b98b314 test(empty-state): trim redundant org context tests 2026-06-11 13:30:06 +05:30
makeavish
45151d71e7 fix(empty-state): preserve telemetry count queries 2026-06-11 13:23:42 +05:30
makeavish
f2e01cedec fix(empty-state): restore last observed telemetry queries 2026-06-11 13:15:44 +05:30
makeavish
7f6e15cd6e feat(empty-state): add org context API for contextual empty states
Adds GET /api/v1/empty_state/org_context returning raw org-level
observability signals (ingestion presence per signal, infra metrics,
alert/dashboard/saved-view counts, firing and recently-fired alerts,
raw license state) consumed by the AI assistant to render contextual
empty-state chips. Includes unit tests and an integration test suite.
2026-06-11 12:09:46 +05:30
131 changed files with 1354 additions and 10613 deletions

View File

@@ -43,6 +43,7 @@ jobs:
- callbackauthn
- cloudintegrations
- dashboard
- emptystate
- ingestionkeys
- inframonitoring
- logspipelines

2
.gitignore vendored
View File

@@ -40,6 +40,8 @@ frontend/src/constants/env.ts
**/__debug_bin
.env
# sqlite db created at repo root by `make go-run-community` / `make go-run-enterprise`
/signoz.db
pkg/query-service/signoz.db
pkg/query-service/tests/test-deploy/data/

View File

@@ -2496,17 +2496,10 @@ components:
$ref: '#/components/schemas/DashboardtypesTimePreference'
type: object
DashboardtypesBuilderQuerySpec:
discriminator:
mapping:
logs: '#/components/schemas/Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5LogAggregation'
metrics: '#/components/schemas/Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5MetricAggregation'
traces: '#/components/schemas/Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5TraceAggregation'
propertyName: signal
oneOf:
- $ref: '#/components/schemas/Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5LogAggregation'
- $ref: '#/components/schemas/Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5MetricAggregation'
- $ref: '#/components/schemas/Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5TraceAggregation'
type: object
DashboardtypesComparisonOperator:
enum:
- above
@@ -2595,13 +2588,8 @@ components:
type: array
type: object
DashboardtypesDatasourcePlugin:
discriminator:
mapping:
signoz/Datasource: '#/components/schemas/DashboardtypesDatasourcePluginVariantStruct'
propertyName: kind
oneOf:
- $ref: '#/components/schemas/DashboardtypesDatasourcePluginVariantStruct'
type: object
DashboardtypesDatasourcePluginKind:
enum:
- signoz/Datasource
@@ -2668,7 +2656,7 @@ components:
$ref: '#/components/schemas/DashboardtypesDashboardSpec'
tags:
items:
$ref: '#/components/schemas/TagtypesGettableTag'
$ref: '#/components/schemas/TagtypesPostableTag'
nullable: true
type: array
updatedAt:
@@ -2745,13 +2733,8 @@ components:
- path
type: object
DashboardtypesLayout:
discriminator:
mapping:
Grid: '#/components/schemas/DashboardtypesLayoutEnvelopeGithubComPersesSpecGoDashboardGridLayoutSpec'
propertyName: kind
oneOf:
- $ref: '#/components/schemas/DashboardtypesLayoutEnvelopeGithubComPersesSpecGoDashboardGridLayoutSpec'
type: object
DashboardtypesLayoutEnvelopeGithubComPersesSpecGoDashboardGridLayoutSpec:
properties:
kind:
@@ -2791,11 +2774,6 @@ components:
- solid
- dashed
type: string
DashboardtypesListOrder:
enum:
- asc
- desc
type: string
DashboardtypesListPanelSpec:
properties:
selectFields:
@@ -2803,12 +2781,6 @@ components:
$ref: '#/components/schemas/TelemetrytypesTelemetryFieldKey'
type: array
type: object
DashboardtypesListSort:
enum:
- updated_at
- created_at
- name
type: string
DashboardtypesListVariableSpec:
properties:
allowAllValue:
@@ -2831,134 +2803,6 @@ components:
nullable: true
type: string
type: object
DashboardtypesListableDashboardForUserV2:
properties:
dashboards:
items:
$ref: '#/components/schemas/DashboardtypesListedDashboardForUserV2'
type: array
tags:
items:
$ref: '#/components/schemas/TagtypesGettableTag'
type: array
total:
format: int64
type: integer
required:
- dashboards
- total
- tags
type: object
DashboardtypesListableDashboardV2:
properties:
dashboards:
items:
$ref: '#/components/schemas/DashboardtypesListedDashboardV2'
type: array
tags:
items:
$ref: '#/components/schemas/TagtypesGettableTag'
type: array
total:
format: int64
type: integer
required:
- dashboards
- total
- tags
type: object
DashboardtypesListedDashboardForUserV2:
properties:
createdAt:
format: date-time
type: string
createdBy:
type: string
id:
type: string
image:
type: string
locked:
type: boolean
name:
type: string
orgId:
type: string
pinned:
type: boolean
schemaVersion:
type: string
source:
$ref: '#/components/schemas/DashboardtypesSource'
spec:
$ref: '#/components/schemas/DashboardtypesListedDashboardV2Spec'
tags:
items:
$ref: '#/components/schemas/TagtypesGettableTag'
type: array
updatedAt:
format: date-time
type: string
updatedBy:
type: string
required:
- id
- orgId
- locked
- source
- schemaVersion
- name
- tags
- spec
- pinned
type: object
DashboardtypesListedDashboardV2:
properties:
createdAt:
format: date-time
type: string
createdBy:
type: string
id:
type: string
image:
type: string
locked:
type: boolean
name:
type: string
orgId:
type: string
schemaVersion:
type: string
source:
$ref: '#/components/schemas/DashboardtypesSource'
spec:
$ref: '#/components/schemas/DashboardtypesListedDashboardV2Spec'
tags:
items:
$ref: '#/components/schemas/TagtypesGettableTag'
type: array
updatedAt:
format: date-time
type: string
updatedBy:
type: string
required:
- id
- orgId
- locked
- source
- schemaVersion
- name
- tags
- spec
type: object
DashboardtypesListedDashboardV2Spec:
properties:
display:
$ref: '#/components/schemas/CommonDisplay'
type: object
DashboardtypesNumberPanelSpec:
properties:
formatting:
@@ -2990,16 +2834,6 @@ components:
- Panel
type: string
DashboardtypesPanelPlugin:
discriminator:
mapping:
signoz/BarChartPanel: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesBarChartPanelSpec'
signoz/HistogramPanel: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesHistogramPanelSpec'
signoz/ListPanel: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesListPanelSpec'
signoz/NumberPanel: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesNumberPanelSpec'
signoz/PieChartPanel: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesPieChartPanelSpec'
signoz/TablePanel: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesTablePanelSpec'
signoz/TimeSeriesPanel: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesTimeSeriesPanelSpec'
propertyName: kind
oneOf:
- $ref: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesTimeSeriesPanelSpec'
- $ref: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesBarChartPanelSpec'
@@ -3008,7 +2842,6 @@ components:
- $ref: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesTablePanelSpec'
- $ref: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesHistogramPanelSpec'
- $ref: '#/components/schemas/DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesListPanelSpec'
type: object
DashboardtypesPanelPluginKind:
enum:
- signoz/TimeSeriesPanel
@@ -3187,15 +3020,6 @@ components:
$ref: '#/components/schemas/DashboardtypesQuerySpec'
type: object
DashboardtypesQueryPlugin:
discriminator:
mapping:
signoz/BuilderQuery: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesBuilderQuerySpec'
signoz/ClickHouseSQL: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5ClickHouseQuery'
signoz/CompositeQuery: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5CompositeQuery'
signoz/Formula: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5QueryBuilderFormula'
signoz/PromQLQuery: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5PromQuery'
signoz/TraceOperator: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5QueryBuilderTraceOperator'
propertyName: kind
oneOf:
- $ref: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesBuilderQuerySpec'
- $ref: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5CompositeQuery'
@@ -3203,7 +3027,6 @@ components:
- $ref: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5PromQuery'
- $ref: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5ClickHouseQuery'
- $ref: '#/components/schemas/DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5QueryBuilderTraceOperator'
type: object
DashboardtypesQueryPluginKind:
enum:
- signoz/BuilderQuery
@@ -3458,15 +3281,9 @@ components:
type: boolean
type: object
DashboardtypesVariable:
discriminator:
mapping:
ListVariable: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesListVariableSpec'
TextVariable: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpec'
propertyName: kind
oneOf:
- $ref: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesListVariableSpec'
- $ref: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpec'
type: object
DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpec:
properties:
kind:
@@ -3492,17 +3309,10 @@ components:
- spec
type: object
DashboardtypesVariablePlugin:
discriminator:
mapping:
signoz/CustomVariable: '#/components/schemas/DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesCustomVariableSpec'
signoz/DynamicVariable: '#/components/schemas/DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesDynamicVariableSpec'
signoz/QueryVariable: '#/components/schemas/DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesQueryVariableSpec'
propertyName: kind
oneOf:
- $ref: '#/components/schemas/DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesDynamicVariableSpec'
- $ref: '#/components/schemas/DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesQueryVariableSpec'
- $ref: '#/components/schemas/DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesCustomVariableSpec'
type: object
DashboardtypesVariablePluginKind:
enum:
- signoz/DynamicVariable
@@ -3545,6 +3355,53 @@ components:
- kind
- spec
type: object
EmptystatetypesLastIngestedAt:
properties:
logs:
description: Null when no logs have been ingested.
format: date-time
nullable: true
type: string
metrics:
description: Null when no metrics have been ingested.
format: date-time
nullable: true
type: string
traces:
description: Null when no traces have been ingested.
format: date-time
nullable: true
type: string
required:
- logs
- traces
- metrics
type: object
EmptystatetypesOrgContext:
properties:
alertsCount:
type: integer
dashboardsCount:
type: integer
hasIngestedData:
type: boolean
lastIngestedAt:
$ref: '#/components/schemas/EmptystatetypesLastIngestedAt'
licenseStatus:
description: Raw Zeus license state. Known values include DEFAULTED, ACTIVATED,
EXPIRED, ISSUED, EVALUATING, EVALUATION_EXPIRED, TERMINATED, CANCELLED.
UNKNOWN is emitted when no license state is available.
type: string
savedViewsCount:
type: integer
required:
- hasIngestedData
- lastIngestedAt
- alertsCount
- dashboardsCount
- savedViewsCount
- licenseStatus
type: object
ErrorsJSON:
properties:
code:
@@ -5705,15 +5562,11 @@ components:
$ref: '#/components/schemas/TelemetrytypesTelemetryFieldKey'
type: array
signal:
enum:
- logs
type: string
$ref: '#/components/schemas/TelemetrytypesSignal'
source:
$ref: '#/components/schemas/TelemetrytypesSource'
stepInterval:
$ref: '#/components/schemas/Querybuildertypesv5Step'
required:
- signal
type: object
Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5MetricAggregation:
properties:
@@ -5760,15 +5613,11 @@ components:
$ref: '#/components/schemas/TelemetrytypesTelemetryFieldKey'
type: array
signal:
enum:
- metrics
type: string
$ref: '#/components/schemas/TelemetrytypesSignal'
source:
$ref: '#/components/schemas/TelemetrytypesSource'
stepInterval:
$ref: '#/components/schemas/Querybuildertypesv5Step'
required:
- signal
type: object
Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5TraceAggregation:
properties:
@@ -5815,15 +5664,11 @@ components:
$ref: '#/components/schemas/TelemetrytypesTelemetryFieldKey'
type: array
signal:
enum:
- traces
type: string
$ref: '#/components/schemas/TelemetrytypesSignal'
source:
$ref: '#/components/schemas/TelemetrytypesSource'
stepInterval:
$ref: '#/components/schemas/Querybuildertypesv5Step'
required:
- signal
type: object
Querybuildertypesv5QueryBuilderTraceOperator:
properties:
@@ -7264,16 +7109,6 @@ components:
required:
- references
type: object
TagtypesGettableTag:
properties:
key:
type: string
value:
type: string
required:
- key
- value
type: object
TagtypesPostableTag:
properties:
key:
@@ -9721,6 +9556,53 @@ paths:
summary: Update downtime schedule
tags:
- downtimeschedules
/api/v1/empty_state/org_context:
get:
deprecated: false
description: This endpoint returns raw org-level observability signals used
to render contextual empty states
operationId: GetOrgContext
responses:
"200":
content:
application/json:
schema:
properties:
data:
$ref: '#/components/schemas/EmptystatetypesOrgContext'
status:
type: string
required:
- status
- data
type: object
description: OK
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Forbidden
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Internal Server Error
security:
- api_key:
- VIEWER
- tokenizer:
- VIEWER
summary: Get org context for empty states
tags:
- emptystate
/api/v1/export_raw_data:
post:
deprecated: false
@@ -13309,82 +13191,6 @@ paths:
tags:
- preferences
/api/v2/dashboards:
get:
deprecated: false
description: Returns a page of v2-shape dashboards for the org. This is the
pure, user-independent list — it carries no pin state. Use ListDashboardsForUserV2
for the personalized, pin-aware list. Supports a filter DSL (`query`), sort
(`updated_at`/`created_at`/`name`), order (`asc`/`desc`), and offset-based
pagination (`limit`/`offset`).
operationId: ListDashboardsV2
parameters:
- in: query
name: query
schema:
type: string
- in: query
name: sort
schema:
$ref: '#/components/schemas/DashboardtypesListSort'
- in: query
name: order
schema:
$ref: '#/components/schemas/DashboardtypesListOrder'
- in: query
name: limit
schema:
type: integer
- in: query
name: offset
schema:
type: integer
responses:
"200":
content:
application/json:
schema:
properties:
data:
$ref: '#/components/schemas/DashboardtypesListableDashboardV2'
status:
type: string
required:
- status
- data
type: object
description: OK
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Bad Request
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Forbidden
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Internal Server Error
security:
- api_key:
- VIEWER
- tokenizer:
- VIEWER
summary: List dashboards (v2)
tags:
- dashboard
post:
deprecated: false
description: This endpoint creates a dashboard in the v2 format that follows
@@ -13443,62 +13249,6 @@ paths:
tags:
- dashboard
/api/v2/dashboards/{id}:
delete:
deprecated: false
description: This endpoint deletes a v2-shape dashboard along with its tag relations.
Locked dashboards are rejected.
operationId: DeleteDashboardV2
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
"204":
content:
application/json:
schema:
type: string
description: No Content
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Bad Request
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Forbidden
"404":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Not Found
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Internal Server Error
security:
- api_key:
- EDITOR
- tokenizer:
- EDITOR
summary: Delete dashboard (v2)
tags:
- dashboard
get:
deprecated: false
description: This endpoint returns a v2-shape dashboard.
@@ -20721,196 +20471,6 @@ paths:
summary: Update my user v2
tags:
- users
/api/v2/users/me/dashboards:
get:
deprecated: false
description: 'Same as ListDashboardsV2 but personalized for the calling user:
each dashboard carries the caller''s `pinned` state, and pinned dashboards
float to the top of the requested ordering. Supports the same filter DSL,
sort, order, and pagination.'
operationId: ListDashboardsForUserV2
parameters:
- in: query
name: query
schema:
type: string
- in: query
name: sort
schema:
$ref: '#/components/schemas/DashboardtypesListSort'
- in: query
name: order
schema:
$ref: '#/components/schemas/DashboardtypesListOrder'
- in: query
name: limit
schema:
type: integer
- in: query
name: offset
schema:
type: integer
responses:
"200":
content:
application/json:
schema:
properties:
data:
$ref: '#/components/schemas/DashboardtypesListableDashboardForUserV2'
status:
type: string
required:
- status
- data
type: object
description: OK
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Bad Request
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Forbidden
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Internal Server Error
security:
- api_key:
- VIEWER
- tokenizer:
- VIEWER
summary: List dashboards for the current user (v2)
tags:
- dashboard
/api/v2/users/me/dashboards/{id}/pins:
delete:
deprecated: false
description: Removes the pin for the calling user. Idempotent — unpinning a
dashboard that wasn't pinned still returns 204.
operationId: UnpinDashboardV2
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
"204":
content:
application/json:
schema:
type: string
description: No Content
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Bad Request
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Forbidden
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Internal Server Error
security:
- api_key:
- VIEWER
- tokenizer:
- VIEWER
summary: Unpin a dashboard for the current user (v2)
tags:
- dashboard
put:
deprecated: false
description: Pins the dashboard for the calling user. A user can pin at most
10 dashboards; pinning when at the limit returns 409. Re-pinning an already-pinned
dashboard is a no-op success.
operationId: PinDashboardV2
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
"204":
content:
application/json:
schema:
type: string
description: No Content
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Bad Request
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Forbidden
"404":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Not Found
"409":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Conflict
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/RenderErrorResponse'
description: Internal Server Error
security:
- api_key:
- VIEWER
- tokenizer:
- VIEWER
summary: Pin a dashboard for the current user (v2)
tags:
- dashboard
/api/v2/users/me/factor_password:
put:
deprecated: false

View File

@@ -333,50 +333,6 @@ func (Step) JSONSchema() (jsonschema.Schema, error) {
}
```
### `oneOf` with a discriminator
For a sum type whose variants are keyed by a property (e.g. `kind`), expose the variants via `JSONSchemaOneOf()` and add a discriminator. Without it, code generators intersect the variants (`A & B & C`) instead of producing a clean discriminated union (`A | B | C`).
The parent keeps its `JSONSchemaOneOf()` (the `oneOf` itself) and *additionally* tags it via `PrepareJSONSchema` with the `x-signoz-discriminator` extension; `signoz.attachDiscriminators` then promotes that marker to a real OpenAPI 3 `discriminator` (and strips the duplicate parent properties) after reflection.
```go
// On the parent: expose the oneOf variants...
func (Plugin) JSONSchemaOneOf() []any {
return []any{FooVariant{}}
}
// ...and tag that same oneOf with the discriminator marker.
func (Plugin) PrepareJSONSchema(s *jsonschema.Schema) error {
if s.ExtraProperties == nil {
s.ExtraProperties = map[string]any{}
}
s.ExtraProperties["x-signoz-discriminator"] = map[string]any{
"propertyName": "kind",
"mapping": map[string]string{
"signoz/Foo": "#/components/schemas/FooVariant",
},
}
return nil
}
```
Each variant must declare the discriminator property (`kind`) and mark it `required`.
This produces the following in the generated OpenAPI spec:
```yaml
Plugin:
discriminator:
propertyName: kind
mapping:
signoz/Foo: '#/components/schemas/FooVariant'
oneOf:
- $ref: '#/components/schemas/FooVariant'
type: object
```
Note the discriminator property lives in the variants, not on the parent — the parent is only the union.
## What should I remember?

View File

@@ -229,39 +229,10 @@ func (module *module) PatchV2(ctx context.Context, orgID valuer.UUID, id valuer.
return module.pkgDashboardModule.PatchV2(ctx, orgID, id, updatedBy, patch)
}
func (module *module) DeleteV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID) error {
return module.store.RunInTx(ctx, func(ctx context.Context) error {
if err := module.store.DeletePublic(ctx, id.String()); err != nil && !errors.Ast(err, errors.TypeNotFound) {
return err
}
return module.pkgDashboardModule.DeleteV2(ctx, orgID, id)
})
}
func (module *module) LockUnlockV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID, updatedBy string, isAdmin bool, lock bool) error {
return module.pkgDashboardModule.LockUnlockV2(ctx, orgID, id, updatedBy, isAdmin, lock)
}
func (module *module) ListV2(ctx context.Context, orgID valuer.UUID, params *dashboardtypes.ListDashboardsV2Params) (*dashboardtypes.ListableDashboardV2, error) {
return module.pkgDashboardModule.ListV2(ctx, orgID, params)
}
func (module *module) ListForUserV2(ctx context.Context, orgID valuer.UUID, userID valuer.UUID, params *dashboardtypes.ListDashboardsV2Params) (*dashboardtypes.ListableDashboardForUserV2, error) {
return module.pkgDashboardModule.ListForUserV2(ctx, orgID, userID, params)
}
func (module *module) PinV2(ctx context.Context, orgID valuer.UUID, userID valuer.UUID, id valuer.UUID) error {
return module.pkgDashboardModule.PinV2(ctx, orgID, userID, id)
}
func (module *module) UnpinV2(ctx context.Context, userID valuer.UUID, id valuer.UUID) error {
return module.pkgDashboardModule.UnpinV2(ctx, userID, id)
}
func (module *module) DeletePreferencesForUser(ctx context.Context, userID valuer.UUID) error {
return module.pkgDashboardModule.DeletePreferencesForUser(ctx, userID)
}
func (module *module) Get(ctx context.Context, orgID valuer.UUID, id valuer.UUID) (*dashboardtypes.Dashboard, error) {
return module.pkgDashboardModule.Get(ctx, orgID, id)
}

View File

@@ -16,11 +16,10 @@ func newFormatter(dialect schema.Dialect) sqlstore.SQLFormatter {
}
func (f *formatter) JSONExtractString(column, path string) []byte {
ops := f.convertJSONPathToPostgres(path)
if len(ops) == 0 {
return f.bunf.AppendIdent(nil, column)
}
return append(f.TextToJsonColumn(column), ops...)
var sql []byte
sql = f.bunf.AppendIdent(sql, column)
sql = append(sql, f.convertJSONPathToPostgres(path)...)
return sql
}
func (f *formatter) JSONType(column, path string) []byte {

View File

@@ -18,19 +18,19 @@ func TestJSONExtractString(t *testing.T) {
name: "simple path",
column: "data",
path: "$.field",
expected: `"data"::jsonb->>'field'`,
expected: `"data"->>'field'`,
},
{
name: "nested path",
column: "metadata",
path: "$.user.name",
expected: `"metadata"::jsonb->'user'->>'name'`,
expected: `"metadata"->'user'->>'name'`,
},
{
name: "deeply nested path",
column: "json_col",
path: "$.level1.level2.level3",
expected: `"json_col"::jsonb->'level1'->'level2'->>'level3'`,
expected: `"json_col"->'level1'->'level2'->>'level3'`,
},
{
name: "root path",

View File

@@ -26,7 +26,6 @@ import type {
DashboardtypesPostablePublicDashboardDTO,
DashboardtypesUpdatableDashboardV2DTO,
DashboardtypesUpdatablePublicDashboardDTO,
DeleteDashboardV2PathParameters,
DeletePublicDashboardPathParameters,
GetDashboardV2200,
GetDashboardV2PathParameters,
@@ -36,17 +35,11 @@ import type {
GetPublicDashboardPathParameters,
GetPublicDashboardWidgetQueryRange200,
GetPublicDashboardWidgetQueryRangePathParameters,
ListDashboardsForUserV2200,
ListDashboardsForUserV2Params,
ListDashboardsV2200,
ListDashboardsV2Params,
LockDashboardV2PathParameters,
PatchDashboardV2200,
PatchDashboardV2PathParameters,
PinDashboardV2PathParameters,
RenderErrorResponseDTO,
UnlockDashboardV2PathParameters,
UnpinDashboardV2PathParameters,
UpdateDashboardV2200,
UpdateDashboardV2PathParameters,
UpdatePublicDashboardPathParameters,
@@ -648,103 +641,6 @@ export const invalidateGetPublicDashboardWidgetQueryRange = async (
return queryClient;
};
/**
* Returns a page of v2-shape dashboards for the org. This is the pure, user-independent list — it carries no pin state. Use ListDashboardsForUserV2 for the personalized, pin-aware list. Supports a filter DSL (`query`), sort (`updated_at`/`created_at`/`name`), order (`asc`/`desc`), and offset-based pagination (`limit`/`offset`).
* @summary List dashboards (v2)
*/
export const listDashboardsV2 = (
params?: ListDashboardsV2Params,
signal?: AbortSignal,
) => {
return GeneratedAPIInstance<ListDashboardsV2200>({
url: `/api/v2/dashboards`,
method: 'GET',
params,
signal,
});
};
export const getListDashboardsV2QueryKey = (
params?: ListDashboardsV2Params,
) => {
return [`/api/v2/dashboards`, ...(params ? [params] : [])] as const;
};
export const getListDashboardsV2QueryOptions = <
TData = Awaited<ReturnType<typeof listDashboardsV2>>,
TError = ErrorType<RenderErrorResponseDTO>,
>(
params?: ListDashboardsV2Params,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof listDashboardsV2>>,
TError,
TData
>;
},
) => {
const { query: queryOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getListDashboardsV2QueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof listDashboardsV2>>> = ({
signal,
}) => listDashboardsV2(params, signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof listDashboardsV2>>,
TError,
TData
> & { queryKey: QueryKey };
};
export type ListDashboardsV2QueryResult = NonNullable<
Awaited<ReturnType<typeof listDashboardsV2>>
>;
export type ListDashboardsV2QueryError = ErrorType<RenderErrorResponseDTO>;
/**
* @summary List dashboards (v2)
*/
export function useListDashboardsV2<
TData = Awaited<ReturnType<typeof listDashboardsV2>>,
TError = ErrorType<RenderErrorResponseDTO>,
>(
params?: ListDashboardsV2Params,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof listDashboardsV2>>,
TError,
TData
>;
},
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
const queryOptions = getListDashboardsV2QueryOptions(params, options);
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
queryKey: QueryKey;
};
return { ...query, queryKey: queryOptions.queryKey };
}
/**
* @summary List dashboards (v2)
*/
export const invalidateListDashboardsV2 = async (
queryClient: QueryClient,
params?: ListDashboardsV2Params,
options?: InvalidateOptions,
): Promise<QueryClient> => {
await queryClient.invalidateQueries(
{ queryKey: getListDashboardsV2QueryKey(params) },
options,
);
return queryClient;
};
/**
* This endpoint creates a dashboard in the v2 format that follows Perses spec.
* @summary Create dashboard (v2)
@@ -828,85 +724,6 @@ export const useCreateDashboardV2 = <
> => {
return useMutation(getCreateDashboardV2MutationOptions(options));
};
/**
* This endpoint deletes a v2-shape dashboard along with its tag relations. Locked dashboards are rejected.
* @summary Delete dashboard (v2)
*/
export const deleteDashboardV2 = (
{ id }: DeleteDashboardV2PathParameters,
signal?: AbortSignal,
) => {
return GeneratedAPIInstance<string>({
url: `/api/v2/dashboards/${id}`,
method: 'DELETE',
signal,
});
};
export const getDeleteDashboardV2MutationOptions = <
TError = ErrorType<RenderErrorResponseDTO>,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteDashboardV2>>,
TError,
{ pathParams: DeleteDashboardV2PathParameters },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof deleteDashboardV2>>,
TError,
{ pathParams: DeleteDashboardV2PathParameters },
TContext
> => {
const mutationKey = ['deleteDashboardV2'];
const { mutation: mutationOptions } = options
? options.mutation &&
'mutationKey' in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction<
Awaited<ReturnType<typeof deleteDashboardV2>>,
{ pathParams: DeleteDashboardV2PathParameters }
> = (props) => {
const { pathParams } = props ?? {};
return deleteDashboardV2(pathParams);
};
return { mutationFn, ...mutationOptions };
};
export type DeleteDashboardV2MutationResult = NonNullable<
Awaited<ReturnType<typeof deleteDashboardV2>>
>;
export type DeleteDashboardV2MutationError = ErrorType<RenderErrorResponseDTO>;
/**
* @summary Delete dashboard (v2)
*/
export const useDeleteDashboardV2 = <
TError = ErrorType<RenderErrorResponseDTO>,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof deleteDashboardV2>>,
TError,
{ pathParams: DeleteDashboardV2PathParameters },
TContext
>;
}): UseMutationResult<
Awaited<ReturnType<typeof deleteDashboardV2>>,
TError,
{ pathParams: DeleteDashboardV2PathParameters },
TContext
> => {
return useMutation(getDeleteDashboardV2MutationOptions(options));
};
/**
* This endpoint returns a v2-shape dashboard.
* @summary Get dashboard (v2)
@@ -1364,260 +1181,3 @@ export const useLockDashboardV2 = <
> => {
return useMutation(getLockDashboardV2MutationOptions(options));
};
/**
* Same as ListDashboardsV2 but personalized for the calling user: each dashboard carries the caller's `pinned` state, and pinned dashboards float to the top of the requested ordering. Supports the same filter DSL, sort, order, and pagination.
* @summary List dashboards for the current user (v2)
*/
export const listDashboardsForUserV2 = (
params?: ListDashboardsForUserV2Params,
signal?: AbortSignal,
) => {
return GeneratedAPIInstance<ListDashboardsForUserV2200>({
url: `/api/v2/users/me/dashboards`,
method: 'GET',
params,
signal,
});
};
export const getListDashboardsForUserV2QueryKey = (
params?: ListDashboardsForUserV2Params,
) => {
return [`/api/v2/users/me/dashboards`, ...(params ? [params] : [])] as const;
};
export const getListDashboardsForUserV2QueryOptions = <
TData = Awaited<ReturnType<typeof listDashboardsForUserV2>>,
TError = ErrorType<RenderErrorResponseDTO>,
>(
params?: ListDashboardsForUserV2Params,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof listDashboardsForUserV2>>,
TError,
TData
>;
},
) => {
const { query: queryOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getListDashboardsForUserV2QueryKey(params);
const queryFn: QueryFunction<
Awaited<ReturnType<typeof listDashboardsForUserV2>>
> = ({ signal }) => listDashboardsForUserV2(params, signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof listDashboardsForUserV2>>,
TError,
TData
> & { queryKey: QueryKey };
};
export type ListDashboardsForUserV2QueryResult = NonNullable<
Awaited<ReturnType<typeof listDashboardsForUserV2>>
>;
export type ListDashboardsForUserV2QueryError =
ErrorType<RenderErrorResponseDTO>;
/**
* @summary List dashboards for the current user (v2)
*/
export function useListDashboardsForUserV2<
TData = Awaited<ReturnType<typeof listDashboardsForUserV2>>,
TError = ErrorType<RenderErrorResponseDTO>,
>(
params?: ListDashboardsForUserV2Params,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof listDashboardsForUserV2>>,
TError,
TData
>;
},
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
const queryOptions = getListDashboardsForUserV2QueryOptions(params, options);
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
queryKey: QueryKey;
};
return { ...query, queryKey: queryOptions.queryKey };
}
/**
* @summary List dashboards for the current user (v2)
*/
export const invalidateListDashboardsForUserV2 = async (
queryClient: QueryClient,
params?: ListDashboardsForUserV2Params,
options?: InvalidateOptions,
): Promise<QueryClient> => {
await queryClient.invalidateQueries(
{ queryKey: getListDashboardsForUserV2QueryKey(params) },
options,
);
return queryClient;
};
/**
* Removes the pin for the calling user. Idempotent — unpinning a dashboard that wasn't pinned still returns 204.
* @summary Unpin a dashboard for the current user (v2)
*/
export const unpinDashboardV2 = (
{ id }: UnpinDashboardV2PathParameters,
signal?: AbortSignal,
) => {
return GeneratedAPIInstance<string>({
url: `/api/v2/users/me/dashboards/${id}/pins`,
method: 'DELETE',
signal,
});
};
export const getUnpinDashboardV2MutationOptions = <
TError = ErrorType<RenderErrorResponseDTO>,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof unpinDashboardV2>>,
TError,
{ pathParams: UnpinDashboardV2PathParameters },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof unpinDashboardV2>>,
TError,
{ pathParams: UnpinDashboardV2PathParameters },
TContext
> => {
const mutationKey = ['unpinDashboardV2'];
const { mutation: mutationOptions } = options
? options.mutation &&
'mutationKey' in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction<
Awaited<ReturnType<typeof unpinDashboardV2>>,
{ pathParams: UnpinDashboardV2PathParameters }
> = (props) => {
const { pathParams } = props ?? {};
return unpinDashboardV2(pathParams);
};
return { mutationFn, ...mutationOptions };
};
export type UnpinDashboardV2MutationResult = NonNullable<
Awaited<ReturnType<typeof unpinDashboardV2>>
>;
export type UnpinDashboardV2MutationError = ErrorType<RenderErrorResponseDTO>;
/**
* @summary Unpin a dashboard for the current user (v2)
*/
export const useUnpinDashboardV2 = <
TError = ErrorType<RenderErrorResponseDTO>,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof unpinDashboardV2>>,
TError,
{ pathParams: UnpinDashboardV2PathParameters },
TContext
>;
}): UseMutationResult<
Awaited<ReturnType<typeof unpinDashboardV2>>,
TError,
{ pathParams: UnpinDashboardV2PathParameters },
TContext
> => {
return useMutation(getUnpinDashboardV2MutationOptions(options));
};
/**
* Pins the dashboard for the calling user. A user can pin at most 10 dashboards; pinning when at the limit returns 409. Re-pinning an already-pinned dashboard is a no-op success.
* @summary Pin a dashboard for the current user (v2)
*/
export const pinDashboardV2 = (
{ id }: PinDashboardV2PathParameters,
signal?: AbortSignal,
) => {
return GeneratedAPIInstance<string>({
url: `/api/v2/users/me/dashboards/${id}/pins`,
method: 'PUT',
signal,
});
};
export const getPinDashboardV2MutationOptions = <
TError = ErrorType<RenderErrorResponseDTO>,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof pinDashboardV2>>,
TError,
{ pathParams: PinDashboardV2PathParameters },
TContext
>;
}): UseMutationOptions<
Awaited<ReturnType<typeof pinDashboardV2>>,
TError,
{ pathParams: PinDashboardV2PathParameters },
TContext
> => {
const mutationKey = ['pinDashboardV2'];
const { mutation: mutationOptions } = options
? options.mutation &&
'mutationKey' in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey } };
const mutationFn: MutationFunction<
Awaited<ReturnType<typeof pinDashboardV2>>,
{ pathParams: PinDashboardV2PathParameters }
> = (props) => {
const { pathParams } = props ?? {};
return pinDashboardV2(pathParams);
};
return { mutationFn, ...mutationOptions };
};
export type PinDashboardV2MutationResult = NonNullable<
Awaited<ReturnType<typeof pinDashboardV2>>
>;
export type PinDashboardV2MutationError = ErrorType<RenderErrorResponseDTO>;
/**
* @summary Pin a dashboard for the current user (v2)
*/
export const usePinDashboardV2 = <
TError = ErrorType<RenderErrorResponseDTO>,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof pinDashboardV2>>,
TError,
{ pathParams: PinDashboardV2PathParameters },
TContext
>;
}): UseMutationResult<
Awaited<ReturnType<typeof pinDashboardV2>>,
TError,
{ pathParams: PinDashboardV2PathParameters },
TContext
> => {
return useMutation(getPinDashboardV2MutationOptions(options));
};

View File

@@ -0,0 +1,107 @@
/**
* ! Do not edit manually
* * The file has been auto-generated using Orval for SigNoz
* * regenerate with 'pnpm generate:api'
* SigNoz
*/
import { useQuery } from 'react-query';
import type {
InvalidateOptions,
QueryClient,
QueryFunction,
QueryKey,
UseQueryOptions,
UseQueryResult,
} from 'react-query';
import type {
GetOrgContext200,
RenderErrorResponseDTO,
} from '../sigNoz.schemas';
import { GeneratedAPIInstance } from '../../../generatedAPIInstance';
import type { ErrorType } from '../../../generatedAPIInstance';
/**
* This endpoint returns raw org-level observability signals used to render contextual empty states
* @summary Get org context for empty states
*/
export const getOrgContext = (signal?: AbortSignal) => {
return GeneratedAPIInstance<GetOrgContext200>({
url: `/api/v1/empty_state/org_context`,
method: 'GET',
signal,
});
};
export const getGetOrgContextQueryKey = () => {
return [`/api/v1/empty_state/org_context`] as const;
};
export const getGetOrgContextQueryOptions = <
TData = Awaited<ReturnType<typeof getOrgContext>>,
TError = ErrorType<RenderErrorResponseDTO>,
>(options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof getOrgContext>>,
TError,
TData
>;
}) => {
const { query: queryOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetOrgContextQueryKey();
const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrgContext>>> = ({
signal,
}) => getOrgContext(signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getOrgContext>>,
TError,
TData
> & { queryKey: QueryKey };
};
export type GetOrgContextQueryResult = NonNullable<
Awaited<ReturnType<typeof getOrgContext>>
>;
export type GetOrgContextQueryError = ErrorType<RenderErrorResponseDTO>;
/**
* @summary Get org context for empty states
*/
export function useGetOrgContext<
TData = Awaited<ReturnType<typeof getOrgContext>>,
TError = ErrorType<RenderErrorResponseDTO>,
>(options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof getOrgContext>>,
TError,
TData
>;
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
const queryOptions = getGetOrgContextQueryOptions(options);
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
queryKey: QueryKey;
};
return { ...query, queryKey: queryOptions.queryKey };
}
/**
* @summary Get org context for empty states
*/
export const invalidateGetOrgContext = async (
queryClient: QueryClient,
options?: InvalidateOptions,
): Promise<QueryClient> => {
await queryClient.invalidateQueries(
{ queryKey: getGetOrgContextQueryKey() },
options,
);
return queryClient;
};

View File

@@ -3495,9 +3495,6 @@ export interface TelemetrytypesTelemetryFieldKeyDTO {
unit?: string;
}
export enum Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5LogAggregationDTOSignal {
logs = 'logs',
}
export enum TelemetrytypesSourceDTO {
meter = 'meter',
}
@@ -3553,11 +3550,7 @@ export interface Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTyp
* @type array
*/
selectFields?: TelemetrytypesTelemetryFieldKeyDTO[];
/**
* @enum logs
* @type string
*/
signal: Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5LogAggregationDTOSignal;
signal?: TelemetrytypesSignalDTO;
source?: TelemetrytypesSourceDTO;
stepInterval?: Querybuildertypesv5StepDTO;
}
@@ -3623,9 +3616,6 @@ export interface Querybuildertypesv5MetricAggregationDTO {
timeAggregation?: MetrictypesTimeAggregationDTO;
}
export enum Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5MetricAggregationDTOSignal {
metrics = 'metrics',
}
export interface Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5MetricAggregationDTO {
/**
* @type array
@@ -3678,11 +3668,7 @@ export interface Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTyp
* @type array
*/
selectFields?: TelemetrytypesTelemetryFieldKeyDTO[];
/**
* @enum metrics
* @type string
*/
signal: Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5MetricAggregationDTOSignal;
signal?: TelemetrytypesSignalDTO;
source?: TelemetrytypesSourceDTO;
stepInterval?: Querybuildertypesv5StepDTO;
}
@@ -3698,9 +3684,6 @@ export interface Querybuildertypesv5TraceAggregationDTO {
expression?: string;
}
export enum Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5TraceAggregationDTOSignal {
traces = 'traces',
}
export interface Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5TraceAggregationDTO {
/**
* @type array
@@ -3753,11 +3736,7 @@ export interface Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTyp
* @type array
*/
selectFields?: TelemetrytypesTelemetryFieldKeyDTO[];
/**
* @enum traces
* @type string
*/
signal: Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5TraceAggregationDTOSignal;
signal?: TelemetrytypesSignalDTO;
source?: TelemetrytypesSourceDTO;
stepInterval?: Querybuildertypesv5StepDTO;
}
@@ -4644,7 +4623,7 @@ export interface DashboardtypesDashboardSpecDTO {
export enum DashboardtypesDatasourcePluginKindDTO {
'signoz/Datasource' = 'signoz/Datasource',
}
export interface TagtypesGettableTagDTO {
export interface TagtypesPostableTagDTO {
/**
* @type string
*/
@@ -4694,7 +4673,7 @@ export interface DashboardtypesGettableDashboardV2DTO {
/**
* @type array,null
*/
tags: TagtypesGettableTagDTO[] | null;
tags: TagtypesPostableTagDTO[] | null;
/**
* @type string
* @format date-time
@@ -4752,157 +4731,6 @@ export interface DashboardtypesJSONPatchOperationDTO {
value?: unknown;
}
export enum DashboardtypesListOrderDTO {
asc = 'asc',
desc = 'desc',
}
export enum DashboardtypesListSortDTO {
updated_at = 'updated_at',
created_at = 'created_at',
name = 'name',
}
export interface DashboardtypesListedDashboardV2SpecDTO {
display?: CommonDisplayDTO;
}
export interface DashboardtypesListedDashboardForUserV2DTO {
/**
* @type string
* @format date-time
*/
createdAt?: string;
/**
* @type string
*/
createdBy?: string;
/**
* @type string
*/
id: string;
/**
* @type string
*/
image?: string;
/**
* @type boolean
*/
locked: boolean;
/**
* @type string
*/
name: string;
/**
* @type string
*/
orgId: string;
/**
* @type boolean
*/
pinned: boolean;
/**
* @type string
*/
schemaVersion: string;
source: DashboardtypesSourceDTO;
spec: DashboardtypesListedDashboardV2SpecDTO;
/**
* @type array
*/
tags: TagtypesGettableTagDTO[];
/**
* @type string
* @format date-time
*/
updatedAt?: string;
/**
* @type string
*/
updatedBy?: string;
}
export interface DashboardtypesListableDashboardForUserV2DTO {
/**
* @type array
*/
dashboards: DashboardtypesListedDashboardForUserV2DTO[];
/**
* @type array
*/
tags: TagtypesGettableTagDTO[];
/**
* @type integer
* @format int64
*/
total: number;
}
export interface DashboardtypesListedDashboardV2DTO {
/**
* @type string
* @format date-time
*/
createdAt?: string;
/**
* @type string
*/
createdBy?: string;
/**
* @type string
*/
id: string;
/**
* @type string
*/
image?: string;
/**
* @type boolean
*/
locked: boolean;
/**
* @type string
*/
name: string;
/**
* @type string
*/
orgId: string;
/**
* @type string
*/
schemaVersion: string;
source: DashboardtypesSourceDTO;
spec: DashboardtypesListedDashboardV2SpecDTO;
/**
* @type array
*/
tags: TagtypesGettableTagDTO[];
/**
* @type string
* @format date-time
*/
updatedAt?: string;
/**
* @type string
*/
updatedBy?: string;
}
export interface DashboardtypesListableDashboardV2DTO {
/**
* @type array
*/
dashboards: DashboardtypesListedDashboardV2DTO[];
/**
* @type array
*/
tags: TagtypesGettableTagDTO[];
/**
* @type integer
* @format int64
*/
total: number;
}
export enum DashboardtypesPanelPluginKindDTO {
'signoz/TimeSeriesPanel' = 'signoz/TimeSeriesPanel',
'signoz/BarChartPanel' = 'signoz/BarChartPanel',
@@ -4919,17 +4747,6 @@ export type DashboardtypesPatchableDashboardV2DTO =
| DashboardtypesJSONPatchOperationDTO[]
| null;
export interface TagtypesPostableTagDTO {
/**
* @type string
*/
key: string;
/**
* @type string
*/
value: string;
}
export interface DashboardtypesPostableDashboardV2DTO {
/**
* @type boolean
@@ -5009,6 +4826,52 @@ export enum DashboardtypesVariablePluginKindDTO {
'signoz/QueryVariable' = 'signoz/QueryVariable',
'signoz/CustomVariable' = 'signoz/CustomVariable',
}
export interface EmptystatetypesLastIngestedAtDTO {
/**
* @type string,null
* @format date-time
* @description Null when no logs have been ingested.
*/
logs: string | null;
/**
* @type string,null
* @format date-time
* @description Null when no metrics have been ingested.
*/
metrics: string | null;
/**
* @type string,null
* @format date-time
* @description Null when no traces have been ingested.
*/
traces: string | null;
}
export interface EmptystatetypesOrgContextDTO {
/**
* @type integer
*/
alertsCount: number;
/**
* @type integer
*/
dashboardsCount: number;
/**
* @type boolean
*/
hasIngestedData: boolean;
lastIngestedAt: EmptystatetypesLastIngestedAtDTO;
/**
* @type string
* @description Raw Zeus license state. Known values include DEFAULTED, ACTIVATED, EXPIRED, ISSUED, EVALUATING, EVALUATION_EXPIRED, TERMINATED, CANCELLED. UNKNOWN is emitted when no license state is available.
*/
licenseStatus: string;
/**
* @type integer
*/
savedViewsCount: number;
}
export type FactoryResponseDTOServicesAnyOf = { [key: string]: string[] };
/**
@@ -9225,6 +9088,14 @@ export type GetDowntimeScheduleByID200 = {
export type UpdateDowntimeScheduleByIDPathParameters = {
id: string;
};
export type GetOrgContext200 = {
data: EmptystatetypesOrgContextDTO;
/**
* @type string
*/
status: string;
};
export type HandleExportRawDataPOSTParams = {
/**
* @enum csv,jsonl
@@ -9832,40 +9703,6 @@ export type GetUserPreference200 = {
export type UpdateUserPreferencePathParameters = {
name: string;
};
export type ListDashboardsV2Params = {
/**
* @type string
* @description undefined
*/
query?: string;
/**
* @description undefined
*/
sort?: DashboardtypesListSortDTO;
/**
* @description undefined
*/
order?: DashboardtypesListOrderDTO;
/**
* @type integer
* @description undefined
*/
limit?: number;
/**
* @type integer
* @description undefined
*/
offset?: number;
};
export type ListDashboardsV2200 = {
data: DashboardtypesListableDashboardV2DTO;
/**
* @type string
*/
status: string;
};
export type CreateDashboardV2201 = {
data: DashboardtypesGettableDashboardV2DTO;
/**
@@ -9874,9 +9711,6 @@ export type CreateDashboardV2201 = {
status: string;
};
export type DeleteDashboardV2PathParameters = {
id: string;
};
export type GetDashboardV2PathParameters = {
id: string;
};
@@ -10709,46 +10543,6 @@ export type GetMyUser200 = {
status: string;
};
export type ListDashboardsForUserV2Params = {
/**
* @type string
* @description undefined
*/
query?: string;
/**
* @description undefined
*/
sort?: DashboardtypesListSortDTO;
/**
* @description undefined
*/
order?: DashboardtypesListOrderDTO;
/**
* @type integer
* @description undefined
*/
limit?: number;
/**
* @type integer
* @description undefined
*/
offset?: number;
};
export type ListDashboardsForUserV2200 = {
data: DashboardtypesListableDashboardForUserV2DTO;
/**
* @type string
*/
status: string;
};
export type UnpinDashboardV2PathParameters = {
id: string;
};
export type PinDashboardV2PathParameters = {
id: string;
};
export type GetHosts200 = {
data: ZeustypesGettableHostDTO;
/**

View File

@@ -1,11 +1,5 @@
// TODO: Improve the styling of the query aggregation container and its components. - @YounixM , @H4ad
$dropdown-base-height: 250px;
$recents-header-height: 30px;
$recent-row-height: 36px;
// how many recents are rendered, this caps how tall the dropdown can grow to fit them.
$max-recents-shown: 5;
.code-mirror-where-clause {
width: 100%;
display: flex;
@@ -123,23 +117,7 @@ $max-recents-shown: 5;
width: 100% !important;
max-width: 100% !important;
font-family: 'Space Mono', monospace !important;
max-height: $dropdown-base-height !important;
overflow-y: auto !important;
// Recents render at the top of the dropdown ahead of regular suggestions.
// At the base max-height, having recents in view would crowd out the
// suggestion list below. This loop grows the dropdown by one row's worth
// of height for every recent present (up to $max-recents-shown), plus the
// section header. `:has(> li:nth-of-type(N) .cm-completionIcon-recent)`
// matches when the Nth child of <ul> is a recent — i.e. there are at
// least N recents visible.
@for $i from 1 through $max-recents-shown {
&:has(> li:nth-of-type(#{$i}) .cm-completionIcon-recent) {
max-height: $dropdown-base-height +
$recents-header-height +
($i * $recent-row-height) !important;
}
}
min-height: 200px !important;
&::-webkit-scrollbar {
width: 0.3rem;
@@ -155,19 +133,6 @@ $max-recents-shown: 5;
background: transparent;
}
completion-section {
display: block;
padding: 10px 12px 6px;
font-size: 10px !important;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--l3-foreground, var(--l2-foreground));
opacity: 0.7;
border-bottom: 0;
background-color: transparent;
}
li {
width: 100% !important;
max-width: 100% !important;
@@ -194,78 +159,11 @@ $max-recents-shown: 5;
display: none !important;
}
.cm-completionDetail {
margin-left: auto;
font-style: normal;
font-size: var(--periscope-font-size-small, 11px);
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
opacity: 0.55;
}
&[aria-selected='true'] {
background: var(--l3-background) !important;
font-weight: 600 !important;
}
}
li:has(.cm-completionIcon-recent) {
&:hover .cm-recent-delete,
&[aria-selected='true'] .cm-recent-delete {
opacity: 1;
}
}
li .cm-completionLabel {
flex: 1;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cm-recent-delete {
margin-left: 8px;
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
padding: 0;
border: 0;
border-radius: 4px;
background: transparent;
color: var(--l2-foreground);
font-size: 18px;
line-height: 1;
cursor: pointer;
opacity: 0.5;
transition:
opacity 0.12s ease,
background-color 0.12s ease;
&:hover {
opacity: 1;
background: color-mix(in srgb, var(--l2-foreground) 18%, transparent);
}
}
}
&::after {
content: '↓↑ to navigate · ↵ to apply · esc to dismiss';
display: block;
padding: 8px 12px;
border-top: 1px solid var(--l1-border);
font-family: 'Space Mono', monospace;
font-size: 11px;
font-weight: 500;
letter-spacing: 0.02em;
color: var(--l2-foreground);
opacity: 0.6;
background: color-mix(in srgb, var(--l1-background) 50%, transparent);
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
}

View File

@@ -46,15 +46,8 @@ import {
import { validateQuery } from 'utils/queryValidationUtils';
import { unquote } from 'utils/stringUtils';
import { getRecentQueries } from 'lib/recentQueries/getRecentQueries';
import type { SignalType } from 'types/api/v5/queryRange';
import { queryExamples, SUGGESTIONS_SECTION } from './constants';
import {
combineInitialAndUserExpression,
getRecentOptions,
renderRecentDeleteButton,
} from './utils';
import { queryExamples } from './constants';
import { combineInitialAndUserExpression } from './utils';
import './QuerySearch.styles.scss';
@@ -1257,41 +1250,6 @@ function QuerySearch({
};
}
const signal = dataSource as SignalType;
function combinedSuggestions(
context: CompletionContext,
): CompletionResult | null {
const fullDoc = context.state.doc.toString();
const recentOptions = getRecentOptions(
getRecentQueries(signal, signalSource ?? ''),
fullDoc,
);
const result = autoSuggestions(context);
const suggestionOptions = (result?.options || []).map((opt) => ({
...opt,
section: SUGGESTIONS_SECTION,
}));
if (recentOptions.length === 0 && suggestionOptions.length === 0) {
return result;
}
if (!result) {
return {
from: 0,
to: fullDoc.length,
options: recentOptions,
};
}
return {
...result,
options: [...recentOptions, ...suggestionOptions],
};
}
// Effect to handle focus state and trigger suggestions
useEffect(() => {
const clearTimeout = toggleSuggestions(10);
@@ -1440,12 +1398,11 @@ function QuerySearch({
})}
extensions={[
autocompletion({
override: [combinedSuggestions],
override: [autoSuggestions],
defaultKeymap: true,
closeOnBlur: true,
activateOnTyping: true,
maxRenderedOptions: 50,
addToOptions: [{ render: renderRecentDeleteButton, position: 100 }],
}),
javascript({ jsx: false, typescript: false }),
EditorView.lineWrapping,

View File

@@ -1,14 +1,3 @@
export const RECENTS_SECTION = { name: 'Recent searches', rank: 1 } as const;
export const SUGGESTIONS_SECTION = { name: 'Suggestions', rank: 2 } as const;
// Custom CodeMirror Completion.type for recent-query entries. Used to discriminate
// recents from regular autocomplete completions in renderers and event handlers.
export const RECENT_COMPLETION_TYPE = 'recent';
// Max number of recents rendered in the autocomplete dropdown.
// Do change $max-recents-shown: in QuerySearch.styles.scss if you change this.
export const RECENTS_DISPLAY_CAP = 5;
export const queryExamples = [
{
label: 'Basic Query',

View File

@@ -1,19 +1,3 @@
import { closeCompletion, startCompletion } from '@codemirror/autocomplete';
import type { Completion } from '@codemirror/autocomplete';
import type { EditorView } from '@uiw/react-codemirror';
import dayjs from 'dayjs';
import { normalizeFilterExpression } from 'lib/recentQueries/normalize';
import * as recentQueriesStore from 'lib/recentQueries/recentQueriesStore';
import type { RecentQueryEntry } from 'lib/recentQueries/types';
import type { SignalType } from 'types/api/v5/queryRange';
import 'utils/timeUtils';
import {
RECENT_COMPLETION_TYPE,
RECENTS_DISPLAY_CAP,
RECENTS_SECTION,
} from './constants';
export function combineInitialAndUserExpression(
initial: string,
user: string,
@@ -54,106 +38,3 @@ export function getUserExpressionFromCombined(
}
return c;
}
// Filters and projects a list of recent-query entries into CodeMirror completions.
// Entries are supplied by the caller (typically via the useRecents hook) so this
// function stays pure and React doesn't have to re-subscribe inside CodeMirror's
// autocomplete callback.
export function getRecentOptions(
entries: RecentQueryEntry[],
fullDoc: string,
): Completion[] {
const normalizedDoc = normalizeFilterExpression(fullDoc);
const matches = entries
.filter((e) => {
const normalizedRecent = normalizeFilterExpression(e.filter.expression);
if (normalizedRecent === normalizedDoc) {
return false;
}
if (normalizedDoc === '') {
return true;
}
return normalizedRecent.includes(normalizedDoc);
})
.slice(0, RECENTS_DISPLAY_CAP);
return matches.map((entry, index) => ({
label: entry.filter.expression,
type: RECENT_COMPLETION_TYPE,
// CodeMirror sorts within a section by boost desc, then label asc. The store
// returns entries newest-first, so we mirror that by giving the newest entry
// the highest boost — otherwise CM falls back to alphabetical order and the
// "most recently used" expectation breaks. Stays within the recents section
// because section.rank keeps recents above suggestions regardless of boost.
boost: matches.length - index,
section: RECENTS_SECTION,
detail: dayjs(entry.lastUsedAt).fromNow(),
recentId: entry.id,
recentSignal: entry.signal,
recentSource: entry.source,
apply: (view: EditorView): void => {
view.dispatch({
changes: {
from: 0,
to: view.state.doc.length,
insert: entry.filter.expression,
},
selection: { anchor: entry.filter.expression.length },
});
closeCompletion(view);
},
}));
}
export function renderRecentDeleteButton(
completion: Completion,
_state: unknown,
view: EditorView | null,
): Node | null {
if (completion.type !== RECENT_COMPLETION_TYPE) {
return null;
}
const c = completion as Completion & {
recentId?: string;
recentSignal?: SignalType;
recentSource?: string;
};
const btn = document.createElement('button');
btn.type = 'button';
btn.className = 'cm-recent-delete';
btn.setAttribute('aria-label', 'Remove from recent searches');
btn.title = 'Remove from recent searches';
btn.textContent = '×';
queueMicrotask(() => {
if (btn.parentElement) {
btn.parentElement.title = completion.label;
}
});
const stop = (e: Event): void => {
e.preventDefault();
e.stopPropagation();
};
// CodeMirror's autocomplete closes the popup on pointerdown / mousedown outside
// the editor. The delete button lives inside the popup, so we must stop those
// events early — otherwise clicking × would dismiss the dropdown before the
// click handler fires and the entry wouldn't actually get removed.
btn.addEventListener('pointerdown', stop);
btn.addEventListener('mousedown', stop);
btn.addEventListener('click', (e) => {
stop(e);
if (!c.recentId || !c.recentSignal) {
return;
}
recentQueriesStore.remove(c.recentId, c.recentSignal, c.recentSource ?? '');
if (view) {
view.focus();
startCompletion(view);
}
});
return btn;
}

View File

@@ -36,7 +36,6 @@ export const REACT_QUERY_KEY = {
GET_TRACE_V4_WATERFALL: 'GET_TRACE_V4_WATERFALL',
GET_TRACE_AGGREGATIONS: 'GET_TRACE_AGGREGATIONS',
GET_TRACE_V2_FLAMEGRAPH: 'GET_TRACE_V2_FLAMEGRAPH',
GET_TRACE_V3_FLAMEGRAPH: 'GET_TRACE_V3_FLAMEGRAPH',
GET_POD_LIST: 'GET_POD_LIST',
GET_NODE_LIST: 'GET_NODE_LIST',
GET_DEPLOYMENT_LIST: 'GET_DEPLOYMENT_LIST',

View File

@@ -40,31 +40,13 @@ type SpeechRecognitionConstructor = new () => ISpeechRecognition;
// ── Vendor-prefix shim for Safari / older browsers ────────────────────────────
// Some hardened/enterprise browsers install a getter
// on window.SpeechRecognition that THROWS on access ("Web Speech API is disabled
// due to your security policy") instead of leaving the property undefined.
// Because this resolves at module-evaluation time, an uncaught throw here aborts
// the entire bundle and the app renders a blank page. Read defensively so a
// throwing getter degrades to "unsupported" rather than crashing the app.
function resolveSpeechRecognitionAPI(): SpeechRecognitionConstructor | null {
if (typeof window === 'undefined') {
return null;
}
try {
return (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any).SpeechRecognition ??
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any).webkitSpeechRecognition ??
null
);
} catch {
return null;
}
}
const SpeechRecognitionAPI: SpeechRecognitionConstructor | null =
resolveSpeechRecognitionAPI();
typeof window !== 'undefined'
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
((window as any).SpeechRecognition ??
(window as any).webkitSpeechRecognition ??
null)
: null;
export type SpeechRecognitionError =
| 'not-supported'

View File

@@ -142,15 +142,6 @@
}
}
.reset-password-back-action {
margin-top: var(--spacing-12);
width: 100%;
button {
width: 100%;
}
}
@media (max-width: 768px) {
width: 100%;
padding: 0 16px;

View File

@@ -1,10 +1,7 @@
import { ArrowLeft, CircleAlert } from '@signozhq/icons';
import { Button } from '@signozhq/ui/button';
import { CircleAlert } from '@signozhq/icons';
import { Typography } from '@signozhq/ui/typography';
import AuthError from 'components/AuthError/AuthError';
import AuthPageContainer from 'components/AuthPageContainer';
import ROUTES from 'constants/routes';
import history from 'lib/history';
import APIError from 'types/api/error';
import './ResetPassword.styles.scss';
@@ -62,16 +59,6 @@ function TokenError({ error }: TokenErrorProps): JSX.Element {
</Typography.Text>
</div>
{error && <AuthError error={error} />}
<div className="reset-password-back-action">
<Button
variant="solid"
data-testid="back-to-login"
prefix={<ArrowLeft size={12} />}
onClick={(): void => history.push(ROUTES.LOGIN)}
>
Back to login
</Button>
</div>
</div>
</AuthPageContainer>
);

View File

@@ -119,10 +119,6 @@
border-radius: 0px 4px 4px 0px;
background: var(--l3-background);
&.version-container-standalone {
border-radius: 4px;
}
}
.version {

View File

@@ -1010,7 +1010,7 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {
<img src={signozBrandLogoUrl} alt="SigNoz" />
</div>
{(licenseTag || currentVersion) && (
{licenseTag && (
<div
className={cx(
'brand-title-section',
@@ -1021,7 +1021,7 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {
'version-update-notification',
)}
>
{licenseTag && <span className="license-type"> {licenseTag} </span>}
<span className="license-type"> {licenseTag} </span>
{currentVersion && (
<Tooltip
@@ -1043,12 +1043,7 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {
)
}
>
<div
className={cx(
'version-container',
!licenseTag && 'version-container-standalone',
)}
>
<div className="version-container">
<span
className={cx('version', changelog && 'version-clickable')}
onClick={onClickVersionHandler}

View File

@@ -1,49 +0,0 @@
import { getFlamegraph } from 'api/generated/services/tracedetail';
import {
SpantypesGettableFlamegraphTraceDTO,
TelemetrytypesTelemetryFieldKeyDTO,
} from 'api/generated/services/sigNoz.schemas';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { useQuery, UseQueryResult } from 'react-query';
import { TelemetryFieldKey } from 'types/api/v5/queryRange';
export interface GetTraceFlamegraphV3Props {
traceId: string;
selectedSpanId?: string;
selectFields?: TelemetryFieldKey[];
}
const useGetTraceFlamegraphV3 = (
props: GetTraceFlamegraphV3Props,
): UseQueryResult<SpantypesGettableFlamegraphTraceDTO, unknown> =>
useQuery({
queryFn: () =>
getFlamegraph(
{ traceID: props.traceId },
{
selectedSpanId: props.selectedSpanId,
// v5 TelemetryFieldKey and the generated DTO are runtime-identical; only
// the literal-union vs enum nominal types differ
selectFields: props.selectFields as TelemetrytypesTelemetryFieldKeyDTO[],
},
).then((res) => ({
...res.data,
// v3 returns span.timestamp in nanoseconds, but the flamegraph render
// pipeline (and the shared v2 page) treat it as milliseconds, matching
// startTimestampMillis. Normalise once here at the data boundary.
spans: (res.data.spans ?? []).map((level) =>
level.map((span) => ({ ...span, timestamp: span.timestamp / 1e6 })),
),
})),
queryKey: [
REACT_QUERY_KEY.GET_TRACE_V3_FLAMEGRAPH,
props.traceId,
props.selectedSpanId,
props.selectFields,
],
enabled: !!props.traceId,
keepPreviousData: true,
refetchOnWindowFocus: false,
});
export default useGetTraceFlamegraphV3;

View File

@@ -1,5 +0,0 @@
export const STORAGE_KEY_PREFIX = 'qb_recent_v1';
export const STORAGE_VERSION = 1;
// Maximum entries kept per (signal, source) bucket. Larger than the UI's
// RECENTS_DISPLAY_CAP so deleting a visible entry surfaces an older one.
export const MAX_ENTRIES = 10;

View File

@@ -1,15 +0,0 @@
import type { SignalType } from 'types/api/v5/queryRange';
import * as store from './recentQueriesStore';
import type { RecentQueryEntry } from './types';
// Synchronous, non-subscribing read of the recent-queries bucket for a given
// (signal, source). Read-on-demand by design — subscribing here would
// reconfigure CodeMirror on every store change and close any open completion
// popup. Pair with saveQuery() for the write path.
export function getRecentQueries(
signal: SignalType,
source = '',
): RecentQueryEntry[] {
return store.list(signal, source);
}

View File

@@ -1,100 +0,0 @@
import { normalizeFilterExpression } from './normalize';
describe('normalizeFilterExpression', () => {
it('returns empty string for empty input', () => {
expect(normalizeFilterExpression('')).toBe('');
});
it('returns empty string for whitespace-only input', () => {
expect(normalizeFilterExpression(' \t ')).toBe('');
});
it('strips whitespace around operators', () => {
expect(normalizeFilterExpression(' a = 1 ')).toBe('a=1');
expect(normalizeFilterExpression('a = 1')).toBe('a=1');
expect(normalizeFilterExpression('a=1')).toBe('a=1');
});
it('lowercases AND / OR / NOT outside quotes', () => {
expect(normalizeFilterExpression('A AND B OR NOT C')).toBe('AandBornotC');
});
it('lowercases IN / LIKE / ILIKE / CONTAINS', () => {
expect(normalizeFilterExpression('host IN [1, 2] AND name LIKE "foo"')).toBe(
'hostin[1,2]andnamelike"foo"',
);
});
it('lowercases REGEXP', () => {
expect(normalizeFilterExpression('path REGEXP "foo"')).toBe(
'pathregexp"foo"',
);
expect(normalizeFilterExpression('path REGEXP "foo"')).toBe(
normalizeFilterExpression('path regexp "foo"'),
);
});
it('lowercases HAS / HASANY / HASALL / HASTOKEN function names', () => {
expect(normalizeFilterExpression('HAS(tags, "x")')).toBe(
normalizeFilterExpression('has(tags, "x")'),
);
expect(normalizeFilterExpression('HASANY(tags, ["a","b"])')).toBe(
normalizeFilterExpression('hasAny(tags, ["a","b"])'),
);
expect(normalizeFilterExpression('HASALL(tags, ["a","b"])')).toBe(
normalizeFilterExpression('hasAll(tags, ["a","b"])'),
);
expect(normalizeFilterExpression('HASTOKEN(msg, "err")')).toBe(
normalizeFilterExpression('hasToken(msg, "err")'),
);
});
it('lowercases TRUE / FALSE boolean literals', () => {
expect(normalizeFilterExpression('active = TRUE')).toBe(
normalizeFilterExpression('active = true'),
);
expect(normalizeFilterExpression('active = FALSE')).toBe(
normalizeFilterExpression('active = false'),
);
});
it('preserves whitespace and casing inside single-quoted strings', () => {
expect(normalizeFilterExpression("a = 'X Y'")).toBe("a='X Y'");
});
it('preserves whitespace and casing inside double-quoted strings', () => {
expect(normalizeFilterExpression('a = "X Y"')).toBe('a="X Y"');
});
it('does not lowercase keyword-looking substrings inside quotes', () => {
expect(normalizeFilterExpression("msg = 'AND ERROR'")).toBe(
"msg='AND ERROR'",
);
});
it('handles escaped quotes inside strings', () => {
expect(normalizeFilterExpression("msg = 'a\\'b' AND x = 1")).toBe(
"msg='a\\'b'andx=1",
);
});
it('treats two formattings of the same expression as identical', () => {
const a = normalizeFilterExpression(
'service.name = "frontend" AND severity = error',
);
const b = normalizeFilterExpression(
'service.name="frontend" and severity=error',
);
expect(a).toBe(b);
});
it('preserves unquoted value casing (treats them as identifiers)', () => {
expect(normalizeFilterExpression('status = OK')).toBe('status=OK');
});
it('handles mixed quotes in one expression', () => {
expect(normalizeFilterExpression(`a = 'X' AND b = "Y"`)).toBe(
`a='X'andb="Y"`,
);
});
});

View File

@@ -1,56 +0,0 @@
import {
OPERATORS,
QUERY_BUILDER_FUNCTIONS,
TRACE_OPERATOR_OPERATORS,
} from 'constants/antlrQueryConstants';
// Reserved keywords sourced from the ANTLR grammar constants so this list stays
// in sync with the parser. `\b` prevents partial matches inside identifiers
// (e.g. `OR` inside `originator`). `TRUE`/`FALSE` are BOOL literals, included
// so case variants of boolean values also dedup.
const WORD_KEYWORDS = [
...Object.keys(OPERATORS).filter((k) => /^[A-Z]+$/.test(k)),
...Object.keys(TRACE_OPERATOR_OPERATORS).filter((k) => /^[A-Z]+$/.test(k)),
...Object.values(QUERY_BUILDER_FUNCTIONS),
'TRUE',
'FALSE',
];
const KEYWORDS_RE = new RegExp(`\\b(${WORD_KEYWORDS.join('|')})\\b`, 'gi');
// Matches single- or double-quoted string literals, supporting escaped quotes
// (e.g. `'it\'s'` or `"a \" b"`). We preserve quoted spans verbatim during
// normalisation so user-meaningful whitespace and casing inside string values
// stays intact: `name = "Foo Bar"` must not collapse to `name="foobar"`.
const QUOTED_RE = /'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/g;
// Lowercases reserved keywords and strips ALL whitespace from the unquoted regions
// of the input. Keywords are normalised so casing variants dedup; whitespace is
// dropped so formatting variants (`a=1` vs `a = 1`) dedup too.
function processOutsideQuotes(s: string): string {
return s.replace(KEYWORDS_RE, (m) => m.toLowerCase()).replace(/\s+/g, '');
}
// Produces a canonical form of a filter expression suitable for dedup-key derivation.
// Walks the input alternating between unquoted regions (where we normalise keywords
// and whitespace) and quoted regions (which we copy verbatim).
export function normalizeFilterExpression(input: string): string {
if (!input) {
return '';
}
let result = '';
let lastIndex = 0;
QUOTED_RE.lastIndex = 0;
let match = QUOTED_RE.exec(input);
while (match !== null) {
result += processOutsideQuotes(input.slice(lastIndex, match.index));
result += match[0];
lastIndex = QUOTED_RE.lastIndex;
match = QUOTED_RE.exec(input);
}
result += processOutsideQuotes(input.slice(lastIndex));
return result.trim();
}

View File

@@ -1,247 +0,0 @@
import { MAX_ENTRIES } from './constants';
import * as store from './recentQueriesStore';
import type { RecentQueryInput } from './recentQueriesStore';
import type { RecentQueryEntry } from './types';
const baseInput = (
overrides: Partial<RecentQueryInput> = {},
): RecentQueryInput => ({
signal: 'logs',
filter: { expression: "service.name = 'frontend'" },
...overrides,
});
function saveOrThrow(input: RecentQueryInput): RecentQueryEntry {
const saved = store.save(input);
if (!saved) {
throw new Error('expected save to return an entry');
}
return saved;
}
describe('recentQueries store', () => {
beforeEach(() => {
store.useRecentQueriesStore.setState({ buckets: {} });
localStorage.clear();
});
describe('save + list', () => {
it('saves an entry and lists it', () => {
store.save(baseInput());
const entries = store.list('logs');
expect(entries).toHaveLength(1);
expect(entries[0].filter.expression).toBe("service.name = 'frontend'");
expect(entries[0].id).toBeTruthy();
expect(entries[0].lastUsedAt).toBeGreaterThan(0);
});
it('does not save when the filter expression is empty', () => {
const result = store.save(baseInput({ filter: { expression: '' } }));
expect(result).toBeNull();
expect(store.list('logs')).toHaveLength(0);
});
it('does not save when the filter expression is whitespace only', () => {
const result = store.save(baseInput({ filter: { expression: ' ' } }));
expect(result).toBeNull();
expect(store.list('logs')).toHaveLength(0);
});
});
describe('LRU ordering', () => {
it('places the most recently saved entry at the front', () => {
store.save(baseInput({ filter: { expression: "severity_text = 'ERROR'" } }));
store.save(baseInput({ filter: { expression: 'http.status_code >= 500' } }));
store.save(baseInput({ filter: { expression: 'attempt = 1' } }));
const entries = store.list('logs');
expect(entries.map((e) => e.filter.expression)).toStrictEqual([
'attempt = 1',
'http.status_code >= 500',
"severity_text = 'ERROR'",
]);
});
it('re-saving an existing filter bumps it to the front', () => {
store.save(baseInput({ filter: { expression: "severity_text = 'ERROR'" } }));
store.save(baseInput({ filter: { expression: 'http.status_code >= 500' } }));
store.save(baseInput({ filter: { expression: "severity_text = 'ERROR'" } }));
const entries = store.list('logs');
expect(entries).toHaveLength(2);
expect(entries.map((e) => e.filter.expression)).toStrictEqual([
"severity_text = 'ERROR'",
'http.status_code >= 500',
]);
});
});
describe('dedup', () => {
it('treats formatting variations of the same filter as one entry', () => {
store.save(
baseInput({
filter: { expression: "severity_text = 'ERROR' AND attempt = 1" },
}),
);
store.save(
baseInput({
filter: { expression: "severity_text='ERROR' and attempt=1" },
}),
);
expect(store.list('logs')).toHaveLength(1);
});
});
describe('signal partitioning', () => {
it('saves to the right bucket per signal', () => {
store.save(
baseInput({
signal: 'logs',
filter: { expression: "severity_text = 'ERROR'" },
}),
);
store.save(
baseInput({
signal: 'traces',
filter: { expression: "service.name = 'orders-api'" },
}),
);
store.save(
baseInput({
signal: 'metrics',
filter: { expression: 'cpu_usage > 80' },
}),
);
expect(store.list('logs')).toHaveLength(1);
expect(store.list('traces')).toHaveLength(1);
expect(store.list('metrics')).toHaveLength(1);
expect(store.list('logs')[0].filter.expression).toBe(
"severity_text = 'ERROR'",
);
expect(store.list('traces')[0].filter.expression).toBe(
"service.name = 'orders-api'",
);
expect(store.list('metrics')[0].filter.expression).toBe('cpu_usage > 80');
});
it('does not leak between signals on dedup', () => {
store.save(
baseInput({
signal: 'logs',
filter: { expression: "service.name = 'frontend'" },
}),
);
store.save(
baseInput({
signal: 'traces',
filter: { expression: "service.name = 'frontend'" },
}),
);
expect(store.list('logs')).toHaveLength(1);
expect(store.list('traces')).toHaveLength(1);
});
});
describe('LRU cap', () => {
it('caps the bucket at MAX_ENTRIES and evicts the oldest', () => {
const total = MAX_ENTRIES + 1;
for (let i = 0; i < total; i += 1) {
store.save(baseInput({ filter: { expression: `attempt = ${i}` } }));
}
const entries = store.list('logs');
expect(entries).toHaveLength(MAX_ENTRIES);
expect(entries[0].filter.expression).toBe(`attempt = ${total - 1}`);
expect(entries.some((e) => e.filter.expression === 'attempt = 0')).toBe(
false,
);
});
});
describe('remove', () => {
it('removes an entry by id', () => {
store.save(baseInput({ filter: { expression: "severity_text = 'ERROR'" } }));
const saved = saveOrThrow(
baseInput({ filter: { expression: 'http.status_code >= 500' } }),
);
store.remove(saved.id, 'logs');
const entries = store.list('logs');
expect(entries).toHaveLength(1);
expect(entries[0].filter.expression).toBe("severity_text = 'ERROR'");
});
it('is a no-op when the id does not exist', () => {
store.save(baseInput({ filter: { expression: "severity_text = 'ERROR'" } }));
store.remove('does-not-exist', 'logs');
expect(store.list('logs')).toHaveLength(1);
});
it('does not touch other signals', () => {
const logsEntry = saveOrThrow(
baseInput({
signal: 'logs',
filter: { expression: "service.name = 'frontend'" },
}),
);
store.save(
baseInput({
signal: 'traces',
filter: { expression: "service.name = 'frontend'" },
}),
);
store.remove(logsEntry.id, 'logs');
expect(store.list('logs')).toHaveLength(0);
expect(store.list('traces')).toHaveLength(1);
});
});
describe('persistence', () => {
it('reads back the same entries after the in-memory state is reset', () => {
store.save(baseInput({ filter: { expression: "severity_text = 'ERROR'" } }));
store.save(baseInput({ filter: { expression: 'http.status_code >= 500' } }));
store.useRecentQueriesStore.setState({ buckets: {} });
const entries = store.list('logs');
expect(entries.map((e) => e.filter.expression)).toStrictEqual([
'http.status_code >= 500',
"severity_text = 'ERROR'",
]);
});
});
describe('reactive subscription via zustand', () => {
it('notifies zustand subscribers on save', () => {
const cb = jest.fn();
const unsubscribe = store.useRecentQueriesStore.subscribe(cb);
store.save(baseInput({ filter: { expression: "severity_text = 'ERROR'" } }));
expect(cb).toHaveBeenCalledTimes(1);
unsubscribe();
});
it('notifies zustand subscribers on remove', () => {
const saved = saveOrThrow(
baseInput({ filter: { expression: "severity_text = 'ERROR'" } }),
);
const cb = jest.fn();
const unsubscribe = store.useRecentQueriesStore.subscribe(cb);
store.remove(saved.id, 'logs');
expect(cb).toHaveBeenCalledTimes(1);
unsubscribe();
});
it('stops notifying after unsubscribe', () => {
const cb = jest.fn();
const unsubscribe = store.useRecentQueriesStore.subscribe(cb);
unsubscribe();
store.save(baseInput({ filter: { expression: "severity_text = 'ERROR'" } }));
expect(cb).not.toHaveBeenCalled();
});
});
});

View File

@@ -1,144 +0,0 @@
import get from 'api/browser/localstorage/get';
import set from 'api/browser/localstorage/set';
import type { SignalType } from 'types/api/v5/queryRange';
import { create } from 'zustand';
import { MAX_ENTRIES, STORAGE_VERSION } from './constants';
import { normalizeFilterExpression } from './normalize';
import type { RecentQueriesStoreShape, RecentQueryEntry } from './types';
import { bucketKey, makeId, normalizeSource, storageKeyFor } from './utils';
// Mirrors parsed localStorage so equal raw strings return the same array ref —
// preserves Object.is for zustand selector bail-out.
const persistedBucketCache = new Map<
string,
{ raw: string; parsed: RecentQueryEntry[] }
>();
function loadBucketFromStorage(
signal: SignalType,
source: string,
): RecentQueryEntry[] | null {
const key = bucketKey(signal, source);
try {
const raw = get(storageKeyFor(signal, source));
if (!raw) {
persistedBucketCache.delete(key);
return null;
}
const cached = persistedBucketCache.get(key);
if (cached && cached.raw === raw) {
return cached.parsed;
}
const parsedShape = JSON.parse(raw) as RecentQueriesStoreShape;
if (
parsedShape?.version !== STORAGE_VERSION ||
!Array.isArray(parsedShape.entries)
) {
persistedBucketCache.delete(key);
return null;
}
persistedBucketCache.set(key, { raw, parsed: parsedShape.entries });
return parsedShape.entries;
} catch {
persistedBucketCache.delete(key);
return null;
}
}
function saveBucketToStorage(
signal: SignalType,
source: string,
entries: RecentQueryEntry[],
): void {
try {
const raw = JSON.stringify({ version: STORAGE_VERSION, entries });
if (set(storageKeyFor(signal, source), raw)) {
persistedBucketCache.set(bucketKey(signal, source), {
raw,
parsed: entries,
});
}
} catch {
// Ignore storage errors (e.g. quota exceeded, JSON.stringify failure).
}
}
export type RecentQueryInput = Omit<
RecentQueryEntry,
'id' | 'lastUsedAt' | 'source'
> & {
source?: string;
};
type RecentQueriesState = {
buckets: Record<string, RecentQueryEntry[]>;
save: (entry: RecentQueryInput) => RecentQueryEntry | null;
remove: (id: string, signal: SignalType, source?: string) => void;
};
export const useRecentQueriesStore = create<RecentQueriesState>()(
(set, get) => ({
buckets: {},
save: (entry): RecentQueryEntry | null => {
const normalized = normalizeFilterExpression(entry.filter.expression);
if (!normalized) {
return null;
}
const source = normalizeSource(entry.source);
const key = bucketKey(entry.signal, source);
const current =
get().buckets[key] ?? loadBucketFromStorage(entry.signal, source) ?? [];
const filtered = current.filter(
(e) => normalizeFilterExpression(e.filter.expression) !== normalized,
);
const newEntry: RecentQueryEntry = {
...entry,
source,
id: makeId(entry.signal, source, normalized),
lastUsedAt: Date.now(),
};
const next = [newEntry, ...filtered].slice(0, MAX_ENTRIES);
set({ buckets: { ...get().buckets, [key]: next } });
saveBucketToStorage(entry.signal, source, next);
return newEntry;
},
remove: (id, signal, source = ''): void => {
const key = bucketKey(signal, source);
const current = get().buckets[key] ?? loadBucketFromStorage(signal, source);
if (!current) {
return;
}
const next = current.filter((e) => e.id !== id);
if (next.length === current.length) {
return;
}
set({ buckets: { ...get().buckets, [key]: next } });
saveBucketToStorage(signal, source, next);
},
}),
);
// Plain-function wrappers for non-React callers — same pattern as useColumnStore.ts.
export function save(entry: RecentQueryInput): RecentQueryEntry | null {
return useRecentQueriesStore.getState().save(entry);
}
export function remove(id: string, signal: SignalType, source = ''): void {
useRecentQueriesStore.getState().remove(id, signal, source);
}
// Synchronous bucket read with localStorage fallback for non-React callers.
export function list(signal: SignalType, source = ''): RecentQueryEntry[] {
const key = bucketKey(signal, source);
const state = useRecentQueriesStore.getState();
if (state.buckets[key]) {
return state.buckets[key];
}
return loadBucketFromStorage(signal, source) ?? [];
}

View File

@@ -1,113 +0,0 @@
import { DataSource } from 'types/common/queryBuilder';
import type { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
import { validateQuery } from 'utils/queryValidationUtils';
import * as store from './recentQueriesStore';
import { saveRecentQuery } from './saveRecentQuery';
jest.mock('utils/queryValidationUtils', () => ({
validateQuery: jest.fn(),
}));
const mockedValidateQuery = validateQuery as jest.MockedFunction<
typeof validateQuery
>;
const buildComposite = (
overrides: Partial<IBuilderQuery>[] = [{}],
): { builder: { queryData: IBuilderQuery[] } } => ({
builder: {
queryData: overrides.map((o, i) => ({
queryName: `Q${i}`,
dataSource: DataSource.LOGS,
aggregateOperator: 'count',
aggregateAttribute: undefined as never,
functions: [],
filter: { expression: 'service.name = "frontend"' },
groupBy: [],
expression: `Q${i}`,
disabled: false,
having: [],
limit: null,
stepInterval: null,
orderBy: [],
legend: '',
...o,
})) as IBuilderQuery[],
},
});
describe('saveRecentQuery', () => {
beforeEach(() => {
store.useRecentQueriesStore.setState({ buckets: {} });
localStorage.clear();
mockedValidateQuery.mockReturnValue({
isValid: true,
message: '',
errors: [],
});
});
it('saves the composite query when validation passes', () => {
saveRecentQuery(buildComposite());
const entries = store.list('logs');
expect(entries).toHaveLength(1);
expect(entries[0].filter.expression).toBe('service.name = "frontend"');
});
it('does not save when validateQuery rejects the expression', () => {
mockedValidateQuery.mockReturnValue({
isValid: false,
message: 'bad',
errors: [],
});
saveRecentQuery(buildComposite());
expect(store.list('logs')).toHaveLength(0);
});
it('does not save a builder query with an empty filter expression', () => {
saveRecentQuery(buildComposite([{ filter: { expression: '' } }]));
expect(store.list('logs')).toHaveLength(0);
});
it('saves each builder query in the composite separately', () => {
saveRecentQuery(
buildComposite([
{
dataSource: DataSource.LOGS,
filter: { expression: "service.name = 'frontend'" },
},
{
dataSource: DataSource.TRACES,
filter: { expression: "service.name = 'orders-api'" },
},
]),
);
expect(store.list('logs')).toHaveLength(1);
expect(store.list('traces')).toHaveLength(1);
});
it('skips builder queries whose dataSource is not a supported signal', () => {
saveRecentQuery(
buildComposite([{ dataSource: 'unknown' as IBuilderQuery['dataSource'] }]),
);
expect(store.list('logs')).toHaveLength(0);
expect(store.list('traces')).toHaveLength(0);
expect(store.list('metrics')).toHaveLength(0);
});
it('is a no-op when the composite is null, undefined, or empty', () => {
saveRecentQuery(null);
saveRecentQuery(undefined);
saveRecentQuery({ builder: { queryData: [] } });
saveRecentQuery({});
expect(store.list('logs')).toHaveLength(0);
});
});

View File

@@ -1,52 +0,0 @@
import type { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
import type { SignalType } from 'types/api/v5/queryRange';
import { validateQuery } from 'utils/queryValidationUtils';
import * as store from './recentQueriesStore';
function toSignal(dataSource: IBuilderQuery['dataSource']): SignalType | null {
if (
dataSource === 'logs' ||
dataSource === 'traces' ||
dataSource === 'metrics'
) {
return dataSource;
}
return null;
}
type CompositeWithBuilder = {
builder?: { queryData?: IBuilderQuery[] };
};
// Persists each builder query in the composite as a recent entry. Call this
// only from explicit user-driven Run triggers — reacting to stagedQuery or any
// other derived state pollutes recents with navigation/refresh/go-to traffic.
export function saveRecentQuery(
query: CompositeWithBuilder | null | undefined,
): void {
const queryData = query?.builder?.queryData;
if (!Array.isArray(queryData) || queryData.length === 0) {
return;
}
queryData.forEach((q) => {
const expression = q.filter?.expression?.trim();
if (!expression) {
return;
}
const validation = validateQuery(expression);
if (!validation.isValid) {
return;
}
const signal = toSignal(q.dataSource);
if (!signal) {
return;
}
store.save({
signal,
source: q.source ?? '',
filter: q.filter ?? { expression: '' },
});
});
}

View File

@@ -1,14 +0,0 @@
import type { Filter, SignalType } from 'types/api/v5/queryRange';
export interface RecentQueryEntry {
id: string;
signal: SignalType;
source: string;
filter: Filter;
lastUsedAt: number;
}
export interface RecentQueriesStoreShape {
version: 1;
entries: RecentQueryEntry[];
}

View File

@@ -1,24 +0,0 @@
import type { SignalType } from 'types/api/v5/queryRange';
import { STORAGE_KEY_PREFIX } from './constants';
export function normalizeSource(source: string | undefined): string {
return source ?? '';
}
export function bucketKey(signal: SignalType, source: string): string {
return `${signal}:${source}`;
}
export function storageKeyFor(signal: SignalType, source: string): string {
return `${STORAGE_KEY_PREFIX}:${bucketKey(signal, source)}`;
}
// Same (signal, source, normalized filter) ⇒ same id ⇒ upsert.
export function makeId(
signal: SignalType,
source: string,
normalizedFilter: string,
): string {
return `${signal}|${source}|${normalizedFilter}`;
}

View File

@@ -2,7 +2,7 @@ import { Logout } from 'api/utils';
import ROUTES from 'constants/routes';
import history from 'lib/history';
import { createErrorResponse, rest, server } from 'mocks-server/server';
import { render, screen, waitFor, fireEvent } from 'tests/test-utils';
import { render, screen, waitFor } from 'tests/test-utils';
import ResetPassword from '../index';
@@ -103,7 +103,6 @@ describe('ResetPassword Page', () => {
expect(
screen.getByText(/reset password token does not exist/i),
).toBeInTheDocument();
expect(screen.getByTestId('back-to-login')).toBeInTheDocument();
});
it('shows "token is expired" when token is expired (401) without redirecting to login', async () => {
@@ -138,32 +137,6 @@ describe('ResetPassword Page', () => {
// 401 from this endpoint must NOT trigger logout/redirect
expect(mockHistoryPush).not.toHaveBeenCalledWith(ROUTES.LOGIN);
expect(Logout).not.toHaveBeenCalled();
expect(screen.getByTestId('back-to-login')).toBeInTheDocument();
});
it('navigates to login when "Back to login" is clicked on error screen', async () => {
server.use(
rest.post(
VERIFY_TOKEN_ENDPOINT,
createErrorResponse(
404,
'reset_password_token_not_found',
'reset password token does not exist',
),
),
);
window.history.pushState({}, '', '/password-reset?token=invalid-token');
render(<ResetPassword />, undefined, {
initialRoute: '/password-reset?token=invalid-token',
});
await waitFor(() => {
expect(screen.getByTestId('back-to-login')).toBeInTheDocument();
});
fireEvent.click(screen.getByTestId('back-to-login'));
expect(mockHistoryPush).toHaveBeenCalledWith(ROUTES.LOGIN);
});
it('redirects to login when no token is in the URL', async () => {

View File

@@ -1,7 +1,7 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useHistory, useLocation, useParams } from 'react-router-dom';
import { Skeleton } from 'antd';
import useGetTraceFlamegraphV3 from 'hooks/trace/useGetTraceFlamegraphV3';
import useGetTraceFlamegraph from 'hooks/trace/useGetTraceFlamegraph';
import useUrlQuery from 'hooks/useUrlQuery';
import { TraceDetailFlamegraphURLProps } from 'types/api/trace/getTraceFlamegraph';
import { SpanV3 } from 'types/api/trace/getTraceV3';
@@ -70,13 +70,17 @@ function TraceFlamegraph({
data,
isFetching,
error: fetchError,
} = useGetTraceFlamegraphV3({
} = useGetTraceFlamegraph({
traceId,
selectedSpanId: selectedSpanIdForFetch,
limit: FLAMEGRAPH_SPAN_LIMIT,
selectFields: flamegraphSelectFields,
});
const spans = useMemo(() => data?.spans || [], [data?.spans]);
const spans = useMemo(
() => data?.payload?.spans || [],
[data?.payload?.spans],
);
const {
layout,
@@ -95,8 +99,8 @@ function TraceFlamegraph({
setFirstSpanAtFetchLevel={setFirstSpanAtFetchLevel}
onSpanClick={handleSpanClick}
traceMetadata={{
startTime: data?.startTimestampMillis || 0,
endTime: data?.endTimestampMillis || 0,
startTime: data?.payload?.startTimestampMillis || 0,
endTime: data?.payload?.endTimestampMillis || 0,
}}
filteredSpanIds={filteredSpanIds}
isFilterActive={isFilterActive}
@@ -120,7 +124,7 @@ function TraceFlamegraph({
if (fetchError || workerError) {
return <Error error={(fetchError || workerError) as any} />;
}
if (data?.spans && data.spans.length === 0) {
if (data?.payload?.spans && data.payload.spans.length === 0) {
return <div>No data found for trace {traceId}</div>;
}
return (
@@ -130,17 +134,17 @@ function TraceFlamegraph({
setFirstSpanAtFetchLevel={setFirstSpanAtFetchLevel}
onSpanClick={handleSpanClick}
traceMetadata={{
startTime: data?.startTimestampMillis || 0,
endTime: data?.endTimestampMillis || 0,
startTime: data?.payload?.startTimestampMillis || 0,
endTime: data?.payload?.endTimestampMillis || 0,
}}
filteredSpanIds={filteredSpanIds}
isFilterActive={isFilterActive}
/>
);
}, [
data?.endTimestampMillis,
data?.startTimestampMillis,
data?.spans,
data?.payload?.endTimestampMillis,
data?.payload?.startTimestampMillis,
data?.payload?.spans,
fetchError,
filteredSpanIds,
firstSpanAtFetchLevel,

View File

@@ -1,12 +1,12 @@
import { render } from '@testing-library/react';
import useGetTraceFlamegraphV3 from 'hooks/trace/useGetTraceFlamegraphV3';
import useGetTraceFlamegraph from 'hooks/trace/useGetTraceFlamegraph';
import { AllTheProviders } from 'tests/test-utils';
import { SpanV3 } from 'types/api/trace/getTraceV3';
import { FLAMEGRAPH_SPAN_LIMIT } from '../constants';
import TraceFlamegraph from '../TraceFlamegraph';
jest.mock('hooks/trace/useGetTraceFlamegraphV3');
jest.mock('hooks/trace/useGetTraceFlamegraph');
// Short-circuit the worker so the test doesn't depend on layout computation.
jest.mock('../hooks/useVisualLayoutWorker', () => ({
@@ -17,8 +17,9 @@ jest.mock('../hooks/useVisualLayoutWorker', () => ({
}),
}));
const mockUseGetTraceFlamegraph =
useGetTraceFlamegraphV3 as jest.MockedFunction<typeof useGetTraceFlamegraphV3>;
const mockUseGetTraceFlamegraph = useGetTraceFlamegraph as jest.MockedFunction<
typeof useGetTraceFlamegraph
>;
function renderFlamegraph(props: {
selectedSpan: SpanV3 | undefined;
@@ -44,7 +45,7 @@ describe('TraceFlamegraph - selectedSpanId pass-through', () => {
beforeEach(() => {
mockUseGetTraceFlamegraph.mockReset();
mockUseGetTraceFlamegraph.mockReturnValue({
data: { spans: [] },
data: { payload: { spans: [] } },
isFetching: false,
error: null,
} as never);

View File

@@ -1,4 +1,4 @@
import { SpantypesFlamegraphSpanDTO as FlamegraphSpan } from 'api/generated/services/sigNoz.schemas';
import { FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
import {
computeVisualLayout,
@@ -14,12 +14,12 @@ function makeSpan(
): FlamegraphSpan {
return {
parentSpanId: '',
traceId: 'trace-1',
hasError: false,
serviceName: 'svc',
name: 'op',
level: 0,
event: [],
resource: {},
attributes: {},
...overrides,
};
}

View File

@@ -1,4 +1,4 @@
import { SpantypesFlamegraphSpanDTO as FlamegraphSpan } from 'api/generated/services/sigNoz.schemas';
import { FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
/** Minimal FlamegraphSpan for unit tests */
export const MOCK_SPAN: FlamegraphSpan = {
@@ -6,12 +6,12 @@ export const MOCK_SPAN: FlamegraphSpan = {
durationNano: 50_000_000, // 50ms
spanId: 'span-1',
parentSpanId: '',
traceId: 'trace-1',
hasError: false,
serviceName: 'test-service',
name: 'test-span',
level: 0,
event: [],
resource: {},
attributes: {},
};
/** Nested spans structure for findSpanById tests */

View File

@@ -65,25 +65,37 @@ describe('Presentation / Styling Utils', () => {
describe('getFlamegraphSpanGroupValue', () => {
it('returns resource[field.name] when present', () => {
const value = getFlamegraphSpanGroupValue(
{ resource: { 'service.name': 'svc-from-resource' } },
{
serviceName: 'legacy',
resource: { 'service.name': 'svc-from-resource' },
},
SERVICE_FIELD,
);
expect(value).toBe('svc-from-resource');
});
it('returns "unknown" for service.name when resource is empty', () => {
const value = getFlamegraphSpanGroupValue({ resource: {} }, SERVICE_FIELD);
expect(value).toBe('unknown');
it('falls back to top-level serviceName for service.name when resource is empty', () => {
const value = getFlamegraphSpanGroupValue(
{ serviceName: 'svc-legacy', resource: {} },
SERVICE_FIELD,
);
expect(value).toBe('svc-legacy');
});
it('returns "unknown" for non-service fields when resource is missing', () => {
const value = getFlamegraphSpanGroupValue({ resource: {} }, HOST_FIELD);
const value = getFlamegraphSpanGroupValue(
{ serviceName: 'svc', resource: {} },
HOST_FIELD,
);
expect(value).toBe('unknown');
});
it('reads host.name from resource when present', () => {
const value = getFlamegraphSpanGroupValue(
{ resource: { 'host.name': 'host-1' } },
{
serviceName: 'svc',
resource: { 'host.name': 'host-1' },
},
HOST_FIELD,
);
expect(value).toBe('host-1');

View File

@@ -1,10 +1,11 @@
/* eslint-disable sonarjs/cognitive-complexity */
import { SpantypesFlamegraphSpanDTO as FlamegraphSpan } from 'api/generated/services/sigNoz.schemas';
import { FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
export interface ConnectorLine {
parentRow: number;
childRow: number;
timestampMs: number;
serviceName: string;
// Snapshot of the child span's resource so draw-time can resolve the
// `colorByField` group value without crossing the worker boundary.
resource?: Record<string, string>;
@@ -158,8 +159,24 @@ export function computeVisualLayout(spans: FlamegraphSpan[][]): VisualLayout {
}
}
// Extract parentSpanId — the field may be missing at runtime when the API
// returns `references` instead. Fall back to the first CHILD_OF reference.
function getParentId(span: FlamegraphSpan): string {
return span.parentSpanId || '';
if (span.parentSpanId) {
return span.parentSpanId;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const refs = (span as any).references as
| Array<{ spanId?: string; refType?: string }>
| undefined;
if (refs) {
for (const ref of refs) {
if (ref.refType === 'CHILD_OF' && ref.spanId) {
return ref.spanId;
}
}
}
return '';
}
// Build children map and identify roots
@@ -463,6 +480,7 @@ export function computeVisualLayout(spans: FlamegraphSpan[][]): VisualLayout {
parentRow,
childRow,
timestampMs: child.timestamp,
serviceName: child.serviceName,
resource: child.resource,
});
}

View File

@@ -1,7 +1,7 @@
import React, { RefObject, useCallback, useMemo, useRef } from 'react';
import { generateColorPair } from 'pages/TraceDetailsV3/utils/generateColorPair';
import { useTraceStore } from 'pages/TraceDetailsV3/stores/traceStore';
import { SpantypesFlamegraphSpanDTO as FlamegraphSpan } from 'api/generated/services/sigNoz.schemas';
import { FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
import { TelemetryFieldKey } from 'types/api/v5/queryRange';
import { ConnectorLine } from '../computeVisualLayout';
@@ -200,7 +200,7 @@ function drawConnectorLines(args: DrawConnectorLinesArgs): void {
}
const groupValue = getFlamegraphSpanGroupValue(
{ resource: conn.resource },
{ serviceName: conn.serviceName, resource: conn.resource },
colorByField,
);
const pair = generateColorPair(groupValue);

View File

@@ -11,9 +11,10 @@ import {
import { useTraceStore } from 'pages/TraceDetailsV3/stores/traceStore';
import { RESERVED_PREVIEW_KEYS } from 'pages/TraceDetailsV3/SpanHoverCard/SpanHoverCard';
import { getSpanAttribute } from 'pages/TraceDetailsV3/utils';
import { SpantypesFlamegraphSpanDTO as FlamegraphSpan } from 'api/generated/services/sigNoz.schemas';
import { FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
import { EventRect, ITraceMetadata, SpanRect } from '../types';
import { EventRect, SpanRect } from '../types';
import { ITraceMetadata } from '../types';
import {
getFlamegraphServiceName,
getFlamegraphSpanGroupValue,
@@ -199,7 +200,7 @@ export function useFlamegraphHover(
if (eventRect) {
const { event, span } = eventRect;
const eventTimeMs = (event.timeUnixNano ?? 0) / 1e6;
const eventTimeMs = event.timeUnixNano / 1e6;
setHoveredEventKey(`${span.spanId}-${event.name}-${event.timeUnixNano}`);
setHoveredSpanId(span.spanId);
setTooltipContent({
@@ -219,10 +220,10 @@ export function useFlamegraphHover(
return isDarkMode ? pair.color : pair.colorDark;
})(),
event: {
name: event.name ?? '',
name: event.name,
timeOffsetMs: eventTimeMs - span.timestamp,
isError: event.isError ?? false,
attributeMap: (event.attributeMap as Record<string, string>) ?? {},
isError: event.isError,
attributeMap: event.attributeMap || {},
},
});
updateCursor(canvas, eventRect.span);

View File

@@ -5,7 +5,7 @@ import {
SetStateAction,
useEffect,
} from 'react';
import { SpantypesFlamegraphSpanDTO as FlamegraphSpan } from 'api/generated/services/sigNoz.schemas';
import { FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
import { MIN_VISIBLE_SPAN_MS } from '../constants';
import { ITraceMetadata } from '../types';

View File

@@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from 'react';
import { SpantypesFlamegraphSpanDTO as FlamegraphSpan } from 'api/generated/services/sigNoz.schemas';
import { FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
import { computeVisualLayout, VisualLayout } from '../computeVisualLayout';
import { LayoutWorkerResponse } from '../visualLayoutWorkerTypes';

View File

@@ -1,8 +1,5 @@
import {
SpantypesEventDTO as FlamegraphEvent,
SpantypesFlamegraphSpanDTO as FlamegraphSpan,
} from 'api/generated/services/sigNoz.schemas';
import { Dispatch, SetStateAction } from 'react';
import { Event, FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
import { VisualLayout } from './computeVisualLayout';
@@ -31,7 +28,7 @@ export interface SpanRect {
}
export interface EventRect {
event: FlamegraphEvent;
event: Event;
span: FlamegraphSpan;
cx: number;
cy: number;

View File

@@ -7,7 +7,7 @@ import {
generateColorPair,
RESERVED_ERROR,
} from 'pages/TraceDetailsV3/utils/generateColorPair';
import { SpantypesFlamegraphSpanDTO as FlamegraphSpan } from 'api/generated/services/sigNoz.schemas';
import { FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
import { TelemetryFieldKey } from 'types/api/v5/queryRange';
import {
@@ -74,25 +74,34 @@ export function getFlamegraphRowMetrics(
/**
* Resolve the displayed service.name for a flamegraph span. Used by tooltips
* (service identity, independent of the active colour-by field). Reads
* `resource['service.name']`.
* (service identity, independent of the active colour-by field). Prefers
* `resource['service.name']` with legacy top-level `serviceName` fallback.
*/
export function getFlamegraphServiceName(
span: Partial<Pick<FlamegraphSpan, 'resource' | 'attributes'>>,
span: Pick<FlamegraphSpan, 'serviceName' | 'resource' | 'attributes'>,
): string {
return getSpanAttribute(span, 'service.name') || '';
return getSpanAttribute(span, 'service.name') || span.serviceName || '';
}
/**
* Resolve the value used to bucket a flamegraph span by colour for the given
* field. Prefers `resource[field.name]` (contract from `selectFields`), falling
* back to `'unknown'`.
* field. Prefers `resource[field.name]` (new contract from `selectFields`).
* For `service.name`, falls back to the legacy top-level `serviceName` when
* resource is empty (backward-compat with backends that haven't shipped
* `selectFields` yet). For other fields, falls back to `'unknown'`.
*/
export function getFlamegraphSpanGroupValue(
span: Partial<Pick<FlamegraphSpan, 'resource' | 'attributes'>>,
span: Pick<FlamegraphSpan, 'serviceName' | 'resource' | 'attributes'>,
field: TelemetryFieldKey,
): string {
return getSpanAttribute(span, field.name) || 'unknown';
const fromAttribute = getSpanAttribute(span, field.name);
if (fromAttribute) {
return fromAttribute;
}
if (field.name === 'service.name') {
return span.serviceName || 'unknown';
}
return 'unknown';
}
interface GetSpanColorArgs {
@@ -287,7 +296,7 @@ export function drawSpanBar(args: DrawSpanBarArgs): void {
return;
}
const eventTimeMs = (event.timeUnixNano ?? 0) / 1e6;
const eventTimeMs = event.timeUnixNano / 1e6;
const eventOffsetPercent =
((eventTimeMs - span.timestamp) / spanDurationMs) * 100;
const clampedOffset = clamp(eventOffsetPercent, 1, 99);
@@ -297,11 +306,7 @@ export function drawSpanBar(args: DrawSpanBarArgs): void {
// Event dots derive from the effective bar color so they track the
// light/dark variant the bar is rendered with.
const parentBarColor = isDarkMode ? color : colorDark;
const dotColor = getEventDotColor(
parentBarColor,
event.isError ?? false,
isDarkMode,
);
const dotColor = getEventDotColor(parentBarColor, event.isError, isDarkMode);
const eventKey = `${span.spanId}-${event.name}-${event.timeUnixNano}`;
const isEventHovered = hoveredEventKey === eventKey;
const dotSize = isEventHovered

View File

@@ -1,4 +1,4 @@
import { SpantypesFlamegraphSpanDTO as FlamegraphSpan } from 'api/generated/services/sigNoz.schemas';
import { FlamegraphSpan } from 'types/api/trace/getTraceFlamegraph';
import { VisualLayout } from './computeVisualLayout';

View File

@@ -41,7 +41,6 @@ import useUrlQuery from 'hooks/useUrlQuery';
import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
import { createNewBuilderItemName } from 'lib/newQueryBuilder/createNewBuilderItemName';
import { getOperatorsBySourceAndPanelType } from 'lib/newQueryBuilder/getOperatorsBySourceAndPanelType';
import { saveRecentQuery } from 'lib/recentQueries/saveRecentQuery';
import { replaceIncorrectObjectFields } from 'lib/replaceIncorrectObjectFields';
import { cloneDeep, get, isEqual, set } from 'lodash-es';
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';
@@ -1032,8 +1031,6 @@ export function QueryBuilderProvider({
if (isExplorer) {
setCalledFromHandleRunQuery(true);
}
saveRecentQuery(currentQuery);
const currentQueryData = {
...currentQuery,
builder: {

View File

@@ -2,7 +2,6 @@ import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import duration from 'dayjs/plugin/duration';
import relativeTime from 'dayjs/plugin/relativeTime';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
@@ -10,7 +9,6 @@ dayjs.extend(utc);
dayjs.extend(customParseFormat);
dayjs.extend(duration);
dayjs.extend(timezone);
dayjs.extend(relativeTime);
export function toUTCEpoch(time: number): number {
const x = new Date();

View File

@@ -14,42 +14,6 @@ import (
)
func (provider *provider) addDashboardRoutes(router *mux.Router) error {
if err := router.Handle("/api/v2/dashboards", handler.New(provider.authzMiddleware.ViewAccess(provider.dashboardHandler.ListV2), handler.OpenAPIDef{
ID: "ListDashboardsV2",
Tags: []string{"dashboard"},
Summary: "List dashboards (v2)",
Description: "Returns a page of v2-shape dashboards for the org. This is the pure, user-independent list — it carries no pin state. Use ListDashboardsForUserV2 for the personalized, pin-aware list. Supports a filter DSL (`query`), sort (`updated_at`/`created_at`/`name`), order (`asc`/`desc`), and offset-based pagination (`limit`/`offset`).",
Request: nil,
RequestQuery: new(dashboardtypes.ListDashboardsV2Params),
RequestContentType: "",
Response: new(dashboardtypes.ListableDashboardV2),
ResponseContentType: "application/json",
SuccessStatusCode: http.StatusOK,
ErrorStatusCodes: []int{http.StatusBadRequest},
Deprecated: false,
SecuritySchemes: newSecuritySchemes(types.RoleViewer),
})).Methods(http.MethodGet).GetError(); err != nil {
return err
}
if err := router.Handle("/api/v2/users/me/dashboards", handler.New(provider.authzMiddleware.ViewAccess(provider.dashboardHandler.ListForUserV2), handler.OpenAPIDef{
ID: "ListDashboardsForUserV2",
Tags: []string{"dashboard"},
Summary: "List dashboards for the current user (v2)",
Description: "Same as ListDashboardsV2 but personalized for the calling user: each dashboard carries the caller's `pinned` state, and pinned dashboards float to the top of the requested ordering. Supports the same filter DSL, sort, order, and pagination.",
Request: nil,
RequestQuery: new(dashboardtypes.ListDashboardsV2Params),
RequestContentType: "",
Response: new(dashboardtypes.ListableDashboardForUserV2),
ResponseContentType: "application/json",
SuccessStatusCode: http.StatusOK,
ErrorStatusCodes: []int{http.StatusBadRequest},
Deprecated: false,
SecuritySchemes: newSecuritySchemes(types.RoleViewer),
})).Methods(http.MethodGet).GetError(); err != nil {
return err
}
if err := router.Handle("/api/v2/dashboards", handler.New(provider.authzMiddleware.EditAccess(provider.dashboardHandler.CreateV2), handler.OpenAPIDef{
ID: "CreateDashboardV2",
Tags: []string{"dashboard"},
@@ -125,23 +89,6 @@ func (provider *provider) addDashboardRoutes(router *mux.Router) error {
return err
}
if err := router.Handle("/api/v2/dashboards/{id}", handler.New(provider.authzMiddleware.EditAccess(provider.dashboardHandler.DeleteV2), handler.OpenAPIDef{
ID: "DeleteDashboardV2",
Tags: []string{"dashboard"},
Summary: "Delete dashboard (v2)",
Description: "This endpoint deletes a v2-shape dashboard along with its tag relations. Locked dashboards are rejected.",
Request: nil,
RequestContentType: "",
Response: nil,
ResponseContentType: "application/json",
SuccessStatusCode: http.StatusNoContent,
ErrorStatusCodes: []int{http.StatusBadRequest, http.StatusNotFound},
Deprecated: false,
SecuritySchemes: newSecuritySchemes(types.RoleEditor),
})).Methods(http.MethodDelete).GetError(); err != nil {
return err
}
if err := router.Handle("/api/v2/dashboards/{id}/lock", handler.New(provider.authzMiddleware.EditAccess(provider.dashboardHandler.LockV2), handler.OpenAPIDef{
ID: "LockDashboardV2",
Tags: []string{"dashboard"},
@@ -176,42 +123,6 @@ func (provider *provider) addDashboardRoutes(router *mux.Router) error {
return err
}
// ViewAccess: pinning only mutates the calling user's pin list, not the
// dashboard itself — anyone who can view a dashboard can bookmark it.
if err := router.Handle("/api/v2/users/me/dashboards/{id}/pins", handler.New(provider.authzMiddleware.ViewAccess(provider.dashboardHandler.PinV2), handler.OpenAPIDef{
ID: "PinDashboardV2",
Tags: []string{"dashboard"},
Summary: "Pin a dashboard for the current user (v2)",
Description: "Pins the dashboard for the calling user. A user can pin at most 10 dashboards; pinning when at the limit returns 409. Re-pinning an already-pinned dashboard is a no-op success.",
Request: nil,
RequestContentType: "",
Response: nil,
ResponseContentType: "application/json",
SuccessStatusCode: http.StatusNoContent,
ErrorStatusCodes: []int{http.StatusBadRequest, http.StatusNotFound, http.StatusConflict},
Deprecated: false,
SecuritySchemes: newSecuritySchemes(types.RoleViewer),
})).Methods(http.MethodPut).GetError(); err != nil {
return err
}
if err := router.Handle("/api/v2/users/me/dashboards/{id}/pins", handler.New(provider.authzMiddleware.ViewAccess(provider.dashboardHandler.UnpinV2), handler.OpenAPIDef{
ID: "UnpinDashboardV2",
Tags: []string{"dashboard"},
Summary: "Unpin a dashboard for the current user (v2)",
Description: "Removes the pin for the calling user. Idempotent — unpinning a dashboard that wasn't pinned still returns 204.",
Request: nil,
RequestContentType: "",
Response: nil,
ResponseContentType: "application/json",
SuccessStatusCode: http.StatusNoContent,
ErrorStatusCodes: []int{http.StatusBadRequest},
Deprecated: false,
SecuritySchemes: newSecuritySchemes(types.RoleViewer),
})).Methods(http.MethodDelete).GetError(); err != nil {
return err
}
if err := router.Handle("/api/v1/dashboards/{id}/public", handler.New(provider.authzMiddleware.AdminAccess(provider.dashboardHandler.CreatePublic), handler.OpenAPIDef{
ID: "CreatePublicDashboard",
Tags: []string{"dashboard"},

View File

@@ -0,0 +1,34 @@
package signozapiserver
import (
"net/http"
"github.com/gorilla/mux"
"github.com/SigNoz/signoz/pkg/http/handler"
"github.com/SigNoz/signoz/pkg/types"
"github.com/SigNoz/signoz/pkg/types/emptystatetypes"
)
func (provider *provider) addEmptyStateRoutes(router *mux.Router) error {
if err := router.Handle("/api/v1/empty_state/org_context", handler.New(
provider.authzMiddleware.ViewAccess(provider.statsReporterHandler.GetOrgContext),
handler.OpenAPIDef{
ID: "GetOrgContext",
Tags: []string{"emptystate"},
Summary: "Get org context for empty states",
Description: "This endpoint returns raw org-level observability signals used to render contextual empty states",
Request: nil,
RequestContentType: "",
Response: new(emptystatetypes.OrgContext),
ResponseContentType: "application/json",
SuccessStatusCode: http.StatusOK,
ErrorStatusCodes: []int{},
SecuritySchemes: newSecuritySchemes(types.RoleViewer),
},
)).Methods(http.MethodGet).GetError(); err != nil {
return err
}
return nil
}

View File

@@ -31,6 +31,7 @@ import (
"github.com/SigNoz/signoz/pkg/modules/user"
"github.com/SigNoz/signoz/pkg/querier"
"github.com/SigNoz/signoz/pkg/ruler"
"github.com/SigNoz/signoz/pkg/statsreporter"
"github.com/SigNoz/signoz/pkg/types"
"github.com/SigNoz/signoz/pkg/types/authtypes"
"github.com/SigNoz/signoz/pkg/zeus"
@@ -57,6 +58,7 @@ type provider struct {
infraMonitoringHandler inframonitoring.Handler
gatewayHandler gateway.Handler
fieldsHandler fields.Handler
statsReporterHandler statsreporter.Handler
authzHandler authz.Handler
rawDataExportHandler rawdataexport.Handler
zeusHandler zeus.Handler
@@ -89,6 +91,7 @@ func NewFactory(
infraMonitoringHandler inframonitoring.Handler,
gatewayHandler gateway.Handler,
fieldsHandler fields.Handler,
statsReporterHandler statsreporter.Handler,
authzHandler authz.Handler,
rawDataExportHandler rawdataexport.Handler,
zeusHandler zeus.Handler,
@@ -124,6 +127,7 @@ func NewFactory(
infraMonitoringHandler,
gatewayHandler,
fieldsHandler,
statsReporterHandler,
authzHandler,
rawDataExportHandler,
zeusHandler,
@@ -161,6 +165,7 @@ func newProvider(
infraMonitoringHandler inframonitoring.Handler,
gatewayHandler gateway.Handler,
fieldsHandler fields.Handler,
statsReporterHandler statsreporter.Handler,
authzHandler authz.Handler,
rawDataExportHandler rawdataexport.Handler,
zeusHandler zeus.Handler,
@@ -197,6 +202,7 @@ func newProvider(
infraMonitoringHandler: infraMonitoringHandler,
gatewayHandler: gatewayHandler,
fieldsHandler: fieldsHandler,
statsReporterHandler: statsReporterHandler,
authzHandler: authzHandler,
rawDataExportHandler: rawDataExportHandler,
zeusHandler: zeusHandler,
@@ -286,6 +292,10 @@ func (provider *provider) AddToRouter(router *mux.Router) error {
return err
}
if err := provider.addEmptyStateRoutes(router); err != nil {
return err
}
if err := provider.addRawDataExportRoutes(router); err != nil {
return err
}

View File

@@ -61,23 +61,11 @@ type Module interface {
GetV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID) (*dashboardtypes.DashboardV2, error)
ListV2(ctx context.Context, orgID valuer.UUID, params *dashboardtypes.ListDashboardsV2Params) (*dashboardtypes.ListableDashboardV2, error)
ListForUserV2(ctx context.Context, orgID valuer.UUID, userID valuer.UUID, params *dashboardtypes.ListDashboardsV2Params) (*dashboardtypes.ListableDashboardForUserV2, error)
UpdateV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID, updatedBy string, updatable dashboardtypes.UpdatableDashboardV2) (*dashboardtypes.DashboardV2, error)
LockUnlockV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID, updatedBy string, isAdmin bool, lock bool) error
PatchV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID, updatedBy string, patch dashboardtypes.PatchableDashboardV2) (*dashboardtypes.DashboardV2, error)
PinV2(ctx context.Context, orgID valuer.UUID, userID valuer.UUID, id valuer.UUID) error
UnpinV2(ctx context.Context, userID valuer.UUID, id valuer.UUID) error
DeleteV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID) error
DeletePreferencesForUser(ctx context.Context, userID valuer.UUID) error
}
type Handler interface {
@@ -108,10 +96,6 @@ type Handler interface {
GetV2(http.ResponseWriter, *http.Request)
ListV2(http.ResponseWriter, *http.Request)
ListForUserV2(http.ResponseWriter, *http.Request)
UpdateV2(http.ResponseWriter, *http.Request)
LockV2(http.ResponseWriter, *http.Request)
@@ -119,10 +103,4 @@ type Handler interface {
UnlockV2(http.ResponseWriter, *http.Request)
PatchV2(http.ResponseWriter, *http.Request)
PinV2(http.ResponseWriter, *http.Request)
UnpinV2(http.ResponseWriter, *http.Request)
DeleteV2(http.ResponseWriter, *http.Request)
}

View File

@@ -1,40 +0,0 @@
package impldashboard
import (
"strings"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/sqlstore"
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
)
type Compiled struct {
SQL string
Args []any
}
func Compile(query string, formatter sqlstore.SQLFormatter) (*Compiled, error) {
if len(query) == 0 {
return nil, nil //nolint:nilnil
}
queryVisitor := newVisitor(formatter)
sql, args, syntaxErrs := queryVisitor.compile(query)
if len(syntaxErrs) > 0 {
return nil, errors.NewInvalidInputf(dashboardtypes.ErrCodeDashboardListFilterInvalid,
"invalid filter query: %s", strings.Join(syntaxErrs, "; "))
}
if len(queryVisitor.errors) > 0 {
return nil, errors.NewInvalidInputf(dashboardtypes.ErrCodeDashboardListFilterInvalid,
"invalid filter query: %s", strings.Join(queryVisitor.errors, "; "))
}
if sql == "" {
return nil, nil //nolint:nilnil
}
return &Compiled{
SQL: sql,
Args: args,
}, nil
}

View File

@@ -1,526 +0,0 @@
package impldashboard
import (
"strings"
"testing"
"time"
"github.com/DATA-DOG/go-sqlmock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/SigNoz/signoz/pkg/sqlstore"
"github.com/SigNoz/signoz/pkg/sqlstore/sqlstoretest"
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
)
type compileCase struct {
subtestName string
dslQueryToCompile string
nilExpected bool
expectedSQL string
expectedArgs []any
expectedErrShouldContain string
}
// kindArg is the tag_relation.kind value bound into every tag EXISTS subquery
// (stored double-encoded, hence the embedded quotes). It leads each tag
// predicate's args, ahead of the tag key.
const kindArg = `"dashboard"`
func runCompileCases(t *testing.T, cases []compileCase) {
t.Helper()
for _, c := range cases {
t.Run(c.subtestName, func(t *testing.T) {
out, err := Compile(c.dslQueryToCompile, formatter(t))
if c.expectedErrShouldContain != "" {
require.Error(t, err)
assert.Contains(t, strings.ToLower(err.Error()), strings.ToLower(c.expectedErrShouldContain))
return
}
require.NoError(t, err)
if c.nilExpected {
assert.Nil(t, out)
return
}
require.NotNil(t, out)
if c.expectedSQL != "" {
assert.Equal(t, normalizeSQL(c.expectedSQL), normalizeSQL(out.SQL))
}
if c.expectedArgs != nil {
require.Len(t, out.Args, len(c.expectedArgs))
for i, want := range c.expectedArgs {
// time.Time values can carry semantically-equal instants
// in different *Location representations (UTC vs Local vs
// FixedZone). Compare via .Equal() instead of DeepEqual.
if wantT, ok := want.(time.Time); ok {
gotT, ok := out.Args[i].(time.Time)
require.True(t, ok, "arg[%d]: want time.Time, got %T", i, out.Args[i])
assert.True(t, wantT.Equal(gotT), "arg[%d]: want %s, got %s", i, wantT, gotT)
continue
}
assert.Equal(t, want, out.Args[i], "arg[%d]", i)
}
}
})
}
}
func TestCompile_Empty(t *testing.T) {
runCompileCases(t, []compileCase{
{subtestName: "empty query yields nil", dslQueryToCompile: "", nilExpected: true},
})
}
func TestCompile_Name(t *testing.T) {
runCompileCases(t, []compileCase{
{
subtestName: "name =",
dslQueryToCompile: `name = 'overview'`,
expectedSQL: `json_extract("dashboard"."data", '$.spec.display.name') = ?`,
expectedArgs: []any{"overview"},
},
{
// QUOTED_TEXT in the grammar covers both '…' and "…" — visitor
// strips whichever quote pair surrounds the value.
subtestName: "name = with double-quoted value",
dslQueryToCompile: `name = "something"`,
expectedSQL: `json_extract("dashboard"."data", '$.spec.display.name') = ?`,
expectedArgs: []any{"something"},
},
{
subtestName: "name CONTAINS",
dslQueryToCompile: `name CONTAINS 'overview'`,
expectedSQL: `json_extract("dashboard"."data", '$.spec.display.name') LIKE ? ESCAPE '\'`,
expectedArgs: []any{"%overview%"},
},
{
subtestName: "name ILIKE — emitted as LOWER(col) LIKE LOWER(?) for dialect parity",
dslQueryToCompile: `name ILIKE 'Prod%'`,
expectedSQL: `lower(json_extract("dashboard"."data", '$.spec.display.name')) LIKE LOWER(?) ESCAPE '\'`,
expectedArgs: []any{"Prod%"},
},
{
subtestName: "CONTAINS escapes % in user input",
dslQueryToCompile: `name CONTAINS '50%'`,
expectedSQL: `json_extract("dashboard"."data", '$.spec.display.name') LIKE ? ESCAPE '\'`,
expectedArgs: []any{`%50\%%`},
},
})
}
func TestCompile_CreatedByLocked(t *testing.T) {
runCompileCases(t, []compileCase{
{
subtestName: "created_by LIKE",
dslQueryToCompile: `created_by LIKE '%@signoz.io'`,
expectedSQL: `dashboard.created_by LIKE ? ESCAPE '\'`,
expectedArgs: []any{"%@signoz.io"},
},
{
subtestName: "locked = true",
dslQueryToCompile: `locked = true`,
expectedSQL: `dashboard.locked = ?`,
expectedArgs: []any{true},
},
})
}
func TestCompile_Timestamps(t *testing.T) {
ist := time.FixedZone("+05:30", 5*60*60+30*60)
runCompileCases(t, []compileCase{
{
subtestName: "created_at >= RFC3339",
dslQueryToCompile: `created_at >= '2026-03-10T00:00:00Z'`,
expectedSQL: `dashboard.created_at >= ?`,
expectedArgs: []any{time.Date(2026, 3, 10, 0, 0, 0, 0, time.UTC)},
},
{
subtestName: "updated_at BETWEEN",
dslQueryToCompile: `updated_at BETWEEN '2026-03-10T00:00:00Z' AND '2026-03-20T00:00:00Z'`,
expectedSQL: `dashboard.updated_at BETWEEN ? AND ?`,
expectedArgs: []any{
time.Date(2026, 3, 10, 0, 0, 0, 0, time.UTC),
time.Date(2026, 3, 20, 0, 0, 0, 0, time.UTC),
},
},
{
subtestName: "created_at >= IST timestamp",
dslQueryToCompile: `created_at >= '2026-03-10T05:30:00+05:30'`,
expectedSQL: `dashboard.created_at >= ?`,
expectedArgs: []any{time.Date(2026, 3, 10, 5, 30, 0, 0, ist)},
},
})
}
// Tag operators wrap each predicate in EXISTS / NOT EXISTS. Any non-reserved
// key is a tag key — `team = 'pulse'` matches a tag with key=team value=pulse,
// `tag = 'prod'` matches a tag with key=tag value=prod, and so on.
func TestCompile_Tag(t *testing.T) {
runCompileCases(t, []compileCase{
{
subtestName: "team = wraps in EXISTS",
dslQueryToCompile: `team = 'pulse'`,
expectedSQL: `
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value = ?
)`,
expectedArgs: []any{kindArg, "team", "pulse"},
},
{
subtestName: "tag = is just a regular tag-key filter",
dslQueryToCompile: `tag = 'database'`,
expectedSQL: `
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value = ?
)`,
expectedArgs: []any{kindArg, "tag", "database"},
},
{
subtestName: "team != wraps in NOT EXISTS with positive inner",
dslQueryToCompile: `team != 'pulse'`,
expectedSQL: `
NOT EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value = ?
)`,
expectedArgs: []any{kindArg, "team", "pulse"},
},
{
subtestName: "team IN — inner is single placeholder list on t.value",
dslQueryToCompile: `team IN ['pulse', 'events']`,
expectedSQL: `
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value IN (?, ?)
)`,
expectedArgs: []any{kindArg, "team", "pulse", "events"},
},
{
subtestName: "team NOT IN",
dslQueryToCompile: `team NOT IN ['pulse', 'events']`,
expectedSQL: `
NOT EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value IN (?, ?)
)`,
expectedArgs: []any{kindArg, "team", "pulse", "events"},
},
{
subtestName: "team LIKE — wildcard on value",
dslQueryToCompile: `team LIKE 'pulse%'`,
expectedSQL: `
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value LIKE ? ESCAPE '\'
)`,
expectedArgs: []any{kindArg, "team", "pulse%"},
},
{
subtestName: "team NOT LIKE",
dslQueryToCompile: `team NOT LIKE 'staging%'`,
expectedSQL: `
NOT EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value LIKE ? ESCAPE '\'
)`,
expectedArgs: []any{kindArg, "team", "staging%"},
},
{
subtestName: "database EXISTS — asserts a tag with key=database is present",
dslQueryToCompile: `database EXISTS`,
expectedSQL: `
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
)`,
expectedArgs: []any{kindArg, "database"},
},
{
subtestName: "database NOT EXISTS",
dslQueryToCompile: `database NOT EXISTS`,
expectedSQL: `
NOT EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
)`,
expectedArgs: []any{kindArg, "database"},
},
{
subtestName: "tag-key matching is case-insensitive — TEAM lowercased",
dslQueryToCompile: `TEAM = 'pulse'`,
expectedSQL: `
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value = ?
)`,
expectedArgs: []any{kindArg, "team", "pulse"},
},
})
}
func TestCompile_BooleanComposition(t *testing.T) {
runCompileCases(t, []compileCase{
{
subtestName: "AND chain — flat arg list",
dslQueryToCompile: `locked = true AND created_by = 'a@b.com'`,
expectedSQL: `(dashboard.locked = ? AND dashboard.created_by = ?)`,
expectedArgs: []any{true, "a@b.com"},
},
{
subtestName: "OR chain",
dslQueryToCompile: `locked = true OR created_by = 'a@b.com'`,
expectedSQL: `(dashboard.locked = ? OR dashboard.created_by = ?)`,
expectedArgs: []any{true, "a@b.com"},
},
{
subtestName: "parens preserve precedence",
dslQueryToCompile: `(locked = true OR locked = false) AND created_by = 'a@b.com'`,
expectedSQL: `((dashboard.locked = ? OR dashboard.locked = ?) AND dashboard.created_by = ?)`,
expectedArgs: []any{true, false, "a@b.com"},
},
})
}
// Distinct from operator-suffix negation (NOT IN / NOT LIKE / NOT EXISTS).
// Driven by the unaryExpression rule (`NOT? primary`), so NOT binds to
// exactly one primary and only widens via parens.
func TestCompile_NOT(t *testing.T) {
runCompileCases(t, []compileCase{
{
subtestName: "NOT on a single comparison",
dslQueryToCompile: `NOT name = 'foo'`,
expectedSQL: `NOT (json_extract("dashboard"."data", '$.spec.display.name') = ?)`,
expectedArgs: []any{"foo"},
},
{
subtestName: "NOT binds tightly to its primary in an AND chain",
dslQueryToCompile: `NOT name = 'foo' AND created_by = 'alice'`,
expectedSQL: `(NOT (json_extract("dashboard"."data", '$.spec.display.name') = ?) AND dashboard.created_by = ?)`,
expectedArgs: []any{"foo", "alice"},
},
{
subtestName: "NOT applied to the second term in an AND chain",
dslQueryToCompile: `locked = true AND NOT name = 'foo'`,
expectedSQL: `(dashboard.locked = ? AND NOT (json_extract("dashboard"."data", '$.spec.display.name') = ?))`,
expectedArgs: []any{true, "foo"},
},
{
subtestName: "NOT around a parenthesized OR",
dslQueryToCompile: `NOT (locked = true OR created_by = 'a@b.com')`,
expectedSQL: `NOT ((dashboard.locked = ? OR dashboard.created_by = ?))`,
expectedArgs: []any{true, "a@b.com"},
},
{
subtestName: "double NOT via parens",
dslQueryToCompile: `NOT (NOT name = 'foo')`,
expectedSQL: `NOT (NOT (json_extract("dashboard"."data", '$.spec.display.name') = ?))`,
expectedArgs: []any{"foo"},
},
{
subtestName: "NOT on a tag equality",
dslQueryToCompile: `NOT team = 'pulse'`,
expectedSQL: `
NOT (
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value = ?
)
)`,
expectedArgs: []any{kindArg, "team", "pulse"},
},
{
subtestName: "NOT team = ... AND name = ...",
dslQueryToCompile: `NOT team = 'pulse' AND name = 'overview'`,
expectedSQL: `
(
NOT (
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value = ?
)
)
AND json_extract("dashboard"."data", '$.spec.display.name') = ?)`,
expectedArgs: []any{kindArg, "team", "pulse", "overview"},
},
})
}
func TestCompile_ComplexExamples(t *testing.T) {
runCompileCases(t, []compileCase{
{
subtestName: "name CONTAINS + tag LIKE + created_by + database =",
dslQueryToCompile: `name CONTAINS 'overview' AND tag LIKE 'prod%' AND created_by = 'naman.verma@signoz.io' AND database = 'mongo'`,
expectedSQL: `
(
json_extract("dashboard"."data", '$.spec.display.name') LIKE ? ESCAPE '\'
AND EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value LIKE ? ESCAPE '\'
)
AND dashboard.created_by = ?
AND EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value = ?
))`,
expectedArgs: []any{"%overview%", kindArg, "tag", "prod%", "naman.verma@signoz.io", kindArg, "database", "mongo"},
},
{
subtestName: "team IN AND database EXISTS",
dslQueryToCompile: `team IN ['pulse', 'events'] AND database EXISTS`,
expectedSQL: `
(
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value IN (?, ?)
)
AND EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
))`,
expectedArgs: []any{kindArg, "team", "pulse", "events", kindArg, "database"},
},
{
subtestName: "nested OR / AND with parens",
dslQueryToCompile: `(database IN ['sql', 'redis', 'mongo'] OR name LIKE '%database%') AND (team = 'pulse' OR name LIKE '%pulse%')`,
expectedSQL: `
(
(
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value IN (?, ?, ?)
)
OR json_extract("dashboard"."data", '$.spec.display.name') LIKE ? ESCAPE '\'
)
AND (
EXISTS (
SELECT 1 FROM tag_relation tr
JOIN tag t ON t.id = tr.tag_id
WHERE tr.kind = ? AND tr.resource_id = dashboard.id
AND LOWER(t.key) = LOWER(?)
AND t.value = ?
)
OR json_extract("dashboard"."data", '$.spec.display.name') LIKE ? ESCAPE '\'
))`,
expectedArgs: []any{kindArg, "database", "sql", "redis", "mongo", "%database%", kindArg, "team", "pulse", "%pulse%"},
},
})
}
func TestCompile_Rejections(t *testing.T) {
runCompileCases(t, []compileCase{
{
subtestName: "rejects op outside per-reserved-key allowlist",
dslQueryToCompile: `name BETWEEN 'a' AND 'z'`,
expectedErrShouldContain: "operator",
},
{
subtestName: "rejects BETWEEN on a tag key",
dslQueryToCompile: `team BETWEEN 'a' AND 'z'`,
expectedErrShouldContain: "operator",
},
{
subtestName: "rejects non-bool on locked",
dslQueryToCompile: `locked = 'yes'`,
expectedErrShouldContain: "boolean",
},
{
subtestName: "rejects non-RFC3339 timestamp",
dslQueryToCompile: `created_at >= 'not-a-date'`,
expectedErrShouldContain: "RFC3339",
},
{
subtestName: "rejects REGEXP — not yet supported",
dslQueryToCompile: `name REGEXP '.*'`,
expectedErrShouldContain: "REGEXP",
},
{
subtestName: "rejects syntax error from grammar",
dslQueryToCompile: `name = `,
expectedErrShouldContain: "syntax",
},
})
}
// Every key in dashboardtypes.ReservedOps must have a matching case in
// visitComparisonForReservedKeys; a key that's reserved but unhandled falls
// through to the "no handler for reserved key" error. Equal is accepted by all
// reserved keys, so `key = 'x'` always reaches the dispatch switch — a missing
// handler surfaces as that error regardless of whether the value type-checks.
func TestCompileReservedKeysAllHandled(t *testing.T) {
for key := range dashboardtypes.ReservedOps {
t.Run(string(key), func(t *testing.T) {
_, err := Compile(string(key)+` = 'x'`, formatter(t))
if err != nil {
assert.NotContains(t, err.Error(), "no handler for reserved key",
"reserved key %q has no handler in visitComparisonForReservedKeys", key)
}
})
}
}
func formatter(t *testing.T) sqlstore.SQLFormatter {
t.Helper()
p := sqlstoretest.New(sqlstore.Config{Provider: "sqlite"}, sqlmock.QueryMatcherEqual)
return p.Formatter()
}
func normalizeSQL(s string) string {
s = strings.Join(strings.Fields(s), " ")
s = strings.ReplaceAll(s, "( ", "(")
s = strings.ReplaceAll(s, " )", ")")
return s
}

View File

@@ -1,581 +0,0 @@
package impldashboard
import (
"fmt"
"strings"
"time"
"github.com/SigNoz/signoz/pkg/parser/filterquery"
grammar "github.com/SigNoz/signoz/pkg/parser/filterquery/grammar"
"github.com/SigNoz/signoz/pkg/sqlstore"
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
qbtypesv5 "github.com/SigNoz/signoz/pkg/types/querybuildertypes/querybuildertypesv5"
"github.com/antlr4-go/antlr/v4"
sqlbuilder "github.com/huandu/go-sqlbuilder"
)
// bunPlaceholderFlavor is any flavor that renders `?` placeholders, which bun
// re-binds to the actual backend (e.g. `$1` for Postgres) at query time.
const bunPlaceholderFlavor = sqlbuilder.SQLite
type visitor struct {
grammar.BaseFilterQueryVisitor
selectBuilder *sqlbuilder.SelectBuilder
formatter sqlstore.SQLFormatter
errors []string
}
func newVisitor(formatter sqlstore.SQLFormatter) *visitor {
return &visitor{
selectBuilder: sqlbuilder.NewSelectBuilder(),
formatter: formatter,
}
}
// compile turns the parse tree into `?`-placeholder WHERE SQL + arguments for bun.
func (v *visitor) compile(query string) (string, []any, []string) {
tree, _, collector := filterquery.Parse(query)
if len(collector.Errors) > 0 {
return "", nil, collector.Errors
}
condition, _ := v.visit(tree).(string)
if condition == "" {
return "", nil, nil
}
sql, arguments := v.selectBuilder.Args.CompileWithFlavor(condition, bunPlaceholderFlavor)
return sql, arguments, nil
}
func (v *visitor) visit(tree antlr.ParseTree) any {
if tree == nil {
return nil
}
return tree.Accept(v)
}
// ════════════════════════════════════════════════════════════════════════
// methods from grammar.BaseFilterQueryVisitor that are overridden
// ════════════════════════════════════════════════════════════════════════
func (v *visitor) VisitQuery(ctx *grammar.QueryContext) any {
return v.visit(ctx.Expression())
}
func (v *visitor) VisitExpression(ctx *grammar.ExpressionContext) any {
return v.visit(ctx.OrExpression())
}
func (v *visitor) VisitOrExpression(ctx *grammar.OrExpressionContext) any {
parts := ctx.AllAndExpression()
conditions := make([]string, 0, len(parts))
for _, part := range parts {
if condition, ok := v.visit(part).(string); ok && condition != "" {
conditions = append(conditions, condition)
}
}
switch len(conditions) {
case 0:
return ""
case 1:
return conditions[0]
default:
return v.selectBuilder.Or(conditions...)
}
}
func (v *visitor) VisitAndExpression(ctx *grammar.AndExpressionContext) any {
parts := ctx.AllUnaryExpression()
conditions := make([]string, 0, len(parts))
for _, part := range parts {
if condition, ok := v.visit(part).(string); ok && condition != "" {
conditions = append(conditions, condition)
}
}
switch len(conditions) {
case 0:
return ""
case 1:
return conditions[0]
default:
return v.selectBuilder.And(conditions...)
}
}
func (v *visitor) VisitUnaryExpression(ctx *grammar.UnaryExpressionContext) any {
condition, _ := v.visit(ctx.Primary()).(string)
if condition == "" {
return ""
}
if ctx.NOT() != nil {
return fmt.Sprintf("NOT (%s)", condition)
}
return condition
}
func (v *visitor) VisitPrimary(ctx *grammar.PrimaryContext) any {
if ctx.OrExpression() != nil {
return v.visit(ctx.OrExpression())
}
if ctx.Comparison() != nil {
return v.visit(ctx.Comparison())
}
// Bare keys, values, full text, and function calls are not part of the
// dashboard list DSL.
v.addError("unsupported expression %q — every term must be of the form `key OP value`", ctx.GetText())
return ""
}
// VisitComparison dispatches a single `key OP value` term. A key that matches
// a reserved DSL key (name, description, etc.) becomes a column-level
// predicate; any other identifier is treated as a tag key — the operator
// applies to the tag's value, with a case-insensitive match on the tag's key.
func (v *visitor) VisitComparison(ctx *grammar.ComparisonContext) any {
key := strings.ToLower(strings.TrimSpace(ctx.Key().GetText()))
operation, ok := v.extractOperation(ctx)
if !ok {
return ""
}
if allowedOperations, isReserved := dashboardtypes.ReservedOps[dashboardtypes.DSLKey(key)]; isReserved {
return v.visitComparisonForReservedKeys(ctx, operation, dashboardtypes.DSLKey(key), allowedOperations)
}
return v.visitComparisonForTags(ctx, operation, key)
}
func (v *visitor) visitComparisonForReservedKeys(ctx *grammar.ComparisonContext, operation qbtypesv5.FilterOperator, key dashboardtypes.DSLKey, allowedOperations map[qbtypesv5.FilterOperator]struct{}) string {
if _, allowed := allowedOperations[operation]; !allowed {
v.addError("operator %s is not allowed for key %q", operationName(operation), key)
return ""
}
switch key {
case dashboardtypes.DSLKeyName:
return v.buildJSONStringComparison(ctx, operation, dashboardtypes.DSLKeyName, "$.spec.display.name")
case dashboardtypes.DSLKeyDescription:
return v.buildJSONStringComparison(ctx, operation, dashboardtypes.DSLKeyDescription, "$.spec.display.description")
case dashboardtypes.DSLKeyCreatedAt:
return v.buildTimestampComparison(ctx, operation, "dashboard.created_at")
case dashboardtypes.DSLKeyUpdatedAt:
return v.buildTimestampComparison(ctx, operation, "dashboard.updated_at")
case dashboardtypes.DSLKeyCreatedBy:
return v.buildStringComparison(ctx, operation, dashboardtypes.DSLKeyCreatedBy, "dashboard.created_by")
case dashboardtypes.DSLKeyLocked:
return v.buildBoolComparison(ctx, operation, "dashboard.locked")
}
// Unreachable for real input: every dashboardtypes.ReservedOps key has a case above, and
// TestCompileReservedKeysAllHandled guards that the two stay in sync.
v.addError("no handler for reserved key %q", key)
return ""
}
func (v *visitor) visitComparisonForTags(ctx *grammar.ComparisonContext, operation qbtypesv5.FilterOperator, tagKey string) string {
if _, allowed := dashboardtypes.TagKeyOps[operation]; !allowed {
v.addError("operator %s is not allowed on a tag-key filter", operationName(operation))
return ""
}
return v.buildTagComparison(ctx, operation, tagKey)
}
func (v *visitor) extractOperation(ctx *grammar.ComparisonContext) (qbtypesv5.FilterOperator, bool) {
// For operators that take an optional leading NOT, Inverse() maps each to
// its Not<X> counterpart.
maybeNot := func(operation qbtypesv5.FilterOperator) qbtypesv5.FilterOperator {
if ctx.NOT() != nil {
return operation.Inverse()
}
return operation
}
switch {
case ctx.EQUALS() != nil:
return qbtypesv5.FilterOperatorEqual, true
case ctx.NOT_EQUALS() != nil, ctx.NEQ() != nil:
return qbtypesv5.FilterOperatorNotEqual, true
case ctx.LT() != nil:
return qbtypesv5.FilterOperatorLessThan, true
case ctx.LE() != nil:
return qbtypesv5.FilterOperatorLessThanOrEq, true
case ctx.GT() != nil:
return qbtypesv5.FilterOperatorGreaterThan, true
case ctx.GE() != nil:
return qbtypesv5.FilterOperatorGreaterThanOrEq, true
case ctx.BETWEEN() != nil:
return maybeNot(qbtypesv5.FilterOperatorBetween), true
case ctx.LIKE() != nil:
return maybeNot(qbtypesv5.FilterOperatorLike), true
case ctx.ILIKE() != nil:
return maybeNot(qbtypesv5.FilterOperatorILike), true
case ctx.CONTAINS() != nil:
return maybeNot(qbtypesv5.FilterOperatorContains), true
case ctx.REGEXP() != nil:
return maybeNot(qbtypesv5.FilterOperatorRegexp), true
case ctx.InClause() != nil:
return qbtypesv5.FilterOperatorIn, true
case ctx.NotInClause() != nil:
return qbtypesv5.FilterOperatorNotIn, true
case ctx.EXISTS() != nil:
return maybeNot(qbtypesv5.FilterOperatorExists), true
}
v.addError("could not determine operator in expression %q", ctx.GetText())
return qbtypesv5.FilterOperatorUnknown, false
}
// ─── per-key emitters ────────────────────────────────────────────────────────
func (v *visitor) buildJSONStringComparison(ctx *grammar.ComparisonContext, operation qbtypesv5.FilterOperator, key dashboardtypes.DSLKey, jsonPath string) string {
columnExpression := string(v.formatter.JSONExtractString("dashboard.data", jsonPath))
return v.buildStringOperation(v.selectBuilder, ctx, operation, columnExpression, string(key))
}
func (v *visitor) buildStringComparison(ctx *grammar.ComparisonContext, operation qbtypesv5.FilterOperator, key dashboardtypes.DSLKey, columnExpression string) string {
return v.buildStringOperation(v.selectBuilder, ctx, operation, columnExpression, string(key))
}
// buildStringOperation covers all the operators the spec allows on text-shaped keys
// (name, description, created_by, and a tag's value). Placeholders are interned
// into builder — the outer builder for column predicates, the subquery builder for
// tag-value predicates — so nested EXISTS arguments thread correctly.
func (v *visitor) buildStringOperation(builder *sqlbuilder.SelectBuilder, ctx *grammar.ComparisonContext, operation qbtypesv5.FilterOperator, columnExpression, keyForError string) string {
switch operation {
case qbtypesv5.FilterOperatorEqual:
val, ok := v.extractSingleStringValue(ctx, keyForError)
if !ok {
return ""
}
return builder.Equal(columnExpression, val)
case qbtypesv5.FilterOperatorNotEqual:
val, ok := v.extractSingleStringValue(ctx, keyForError)
if !ok {
return ""
}
return builder.NotEqual(columnExpression, val)
case qbtypesv5.FilterOperatorLike, qbtypesv5.FilterOperatorNotLike:
val, ok := v.extractSingleStringValue(ctx, keyForError)
if !ok {
return ""
}
like := "LIKE"
if operation == qbtypesv5.FilterOperatorNotLike {
like = "NOT LIKE"
}
// The user's % and _ stay as wildcards; ESCAPE pins backslash as the escape
// char so a literal `\` in the pattern is read the same on both dialects —
// Postgres defaults to `\`, SQLite has no default escape.
return fmt.Sprintf("%s %s %s ESCAPE '\\'", columnExpression, like, builder.Var(val))
case qbtypesv5.FilterOperatorILike, qbtypesv5.FilterOperatorNotILike:
val, ok := v.extractSingleStringValue(ctx, keyForError)
if !ok {
return ""
}
// SQLite has no ILIKE keyword and Postgres LIKE is case-sensitive — emit
// LOWER(col) LIKE LOWER(?) so behavior is identical on both dialects. ESCAPE
// pins backslash as the escape char (Postgres default; SQLite has none).
lowerColumn := string(v.formatter.LowerExpression(columnExpression))
like := "LIKE"
if operation == qbtypesv5.FilterOperatorNotILike {
like = "NOT LIKE"
}
return fmt.Sprintf("%s %s LOWER(%s) ESCAPE '\\'", lowerColumn, like, builder.Var(val))
case qbtypesv5.FilterOperatorContains, qbtypesv5.FilterOperatorNotContains:
val, ok := v.extractSingleStringValue(ctx, keyForError)
if !ok {
return ""
}
like := "LIKE"
if operation == qbtypesv5.FilterOperatorNotContains {
like = "NOT LIKE"
}
// Escape the user's % and _ so they match literally, then wrap in wildcards.
// ESCAPE declares the backslash we just injected as the escape char — needed
// on SQLite (no default) and a harmless restatement of the Postgres default.
escaped := strings.NewReplacer(`\`, `\\`, `%`, `\%`, `_`, `\_`).Replace(val)
return fmt.Sprintf("%s %s %s ESCAPE '\\'", columnExpression, like, builder.Var("%"+escaped+"%"))
case qbtypesv5.FilterOperatorRegexp, qbtypesv5.FilterOperatorNotRegexp:
v.addError("REGEXP filtering on %q is not yet supported", keyForError)
return ""
case qbtypesv5.FilterOperatorIn, qbtypesv5.FilterOperatorNotIn:
values, ok := v.extractStringValueList(ctx, keyForError)
if !ok {
return ""
}
arguments := make([]any, len(values))
for i, s := range values {
arguments[i] = s
}
if operation == qbtypesv5.FilterOperatorNotIn {
return builder.NotIn(columnExpression, arguments...)
}
return builder.In(columnExpression, arguments...)
}
v.addError("operator %s on %q is not implemented", operationName(operation), keyForError)
return ""
}
func (v *visitor) buildTimestampComparison(ctx *grammar.ComparisonContext, operation qbtypesv5.FilterOperator, columnExpression string) string {
switch operation {
case qbtypesv5.FilterOperatorEqual, qbtypesv5.FilterOperatorNotEqual,
qbtypesv5.FilterOperatorLessThan, qbtypesv5.FilterOperatorLessThanOrEq,
qbtypesv5.FilterOperatorGreaterThan, qbtypesv5.FilterOperatorGreaterThanOrEq:
t, ok := v.extractSingleTimestampValue(ctx)
if !ok {
return ""
}
switch operation {
case qbtypesv5.FilterOperatorEqual:
return v.selectBuilder.Equal(columnExpression, t)
case qbtypesv5.FilterOperatorNotEqual:
return v.selectBuilder.NotEqual(columnExpression, t)
case qbtypesv5.FilterOperatorLessThan:
return v.selectBuilder.LessThan(columnExpression, t)
case qbtypesv5.FilterOperatorLessThanOrEq:
return v.selectBuilder.LessEqualThan(columnExpression, t)
case qbtypesv5.FilterOperatorGreaterThan:
return v.selectBuilder.GreaterThan(columnExpression, t)
case qbtypesv5.FilterOperatorGreaterThanOrEq:
return v.selectBuilder.GreaterEqualThan(columnExpression, t)
}
case qbtypesv5.FilterOperatorBetween, qbtypesv5.FilterOperatorNotBetween:
timestamps, ok := v.extractTwoTimestampValues(ctx)
if !ok {
return ""
}
if operation == qbtypesv5.FilterOperatorNotBetween {
return v.selectBuilder.NotBetween(columnExpression, timestamps[0], timestamps[1])
}
return v.selectBuilder.Between(columnExpression, timestamps[0], timestamps[1])
}
v.addError("operator %s on timestamp is not implemented", operationName(operation))
return ""
}
func (v *visitor) buildBoolComparison(ctx *grammar.ComparisonContext, operation qbtypesv5.FilterOperator, columnExpression string) string {
b, ok := v.extractSingleBoolValue(ctx)
if !ok {
return ""
}
if operation == qbtypesv5.FilterOperatorNotEqual {
return v.selectBuilder.NotEqual(columnExpression, b)
}
return v.selectBuilder.Equal(columnExpression, b)
}
func (v *visitor) buildTagComparison(ctx *grammar.ComparisonContext, operation qbtypesv5.FilterOperator, tagKey string) string {
subqueryBuilder := sqlbuilder.NewSelectBuilder()
if operation == qbtypesv5.FilterOperatorExists || operation == qbtypesv5.FilterOperatorNotExists {
buildSubqueryForTagKey(subqueryBuilder, tagKey)
} else {
// All other tag operators take the positive form of the value predicate
// and toggle the EXISTS wrapper for negation. Inverse() flips Not<X> → <X>.
positiveOperation := operation
if operation.IsNegativeOperator() {
positiveOperation = operation.Inverse()
}
valuePredicate := v.buildStringOperation(subqueryBuilder, ctx, positiveOperation, "t.value", tagKey)
if valuePredicate == "" {
return ""
}
buildSubqueryForTagKeyAndValue(subqueryBuilder, tagKey, valuePredicate)
}
if operation.IsNegativeOperator() {
return v.selectBuilder.NotExists(subqueryBuilder)
}
return v.selectBuilder.Exists(subqueryBuilder)
}
func buildSubqueryForTagKey(subqueryBuilder *sqlbuilder.SelectBuilder, tagKey string) *sqlbuilder.SelectBuilder {
const dashboardTagKind = `"dashboard"`
return subqueryBuilder.
Select("1").
From("tag_relation tr").
Join("tag t", "t.id = tr.tag_id").
Where(
subqueryBuilder.Equal("tr.kind", dashboardTagKind),
"tr.resource_id = dashboard.id",
"LOWER(t.key) = LOWER("+subqueryBuilder.Var(tagKey)+")",
)
}
func buildSubqueryForTagKeyAndValue(subqueryBuilder *sqlbuilder.SelectBuilder, tagKey, valuePredicate string) *sqlbuilder.SelectBuilder {
return buildSubqueryForTagKey(subqueryBuilder, tagKey).Where(valuePredicate)
}
// ─── value extraction helpers ───────────────────────────────────────────────
func (v *visitor) addError(format string, arguments ...any) {
v.errors = append(v.errors, fmt.Sprintf(format, arguments...))
}
func (v *visitor) extractSingleStringValue(ctx *grammar.ComparisonContext, keyForError string) (string, bool) {
values := ctx.AllValue()
if len(values) != 1 {
v.addError("expected exactly one value for %q", keyForError)
return "", false
}
return v.extractStringValue(values[0], keyForError)
}
func (v *visitor) extractSingleBoolValue(ctx *grammar.ComparisonContext) (bool, bool) {
values := ctx.AllValue()
if len(values) != 1 {
v.addError("expected a single boolean (true/false)")
return false, false
}
return v.extractBoolValue(values[0])
}
func (v *visitor) extractSingleTimestampValue(ctx *grammar.ComparisonContext) (time.Time, bool) {
values := ctx.AllValue()
if len(values) != 1 {
v.addError("expected a single RFC3339 timestamp")
return time.Time{}, false
}
return v.extractTimestampValue(values[0])
}
func (v *visitor) extractTwoTimestampValues(ctx *grammar.ComparisonContext) ([2]time.Time, bool) {
values := ctx.AllValue()
if len(values) != 2 {
v.addError("BETWEEN expects two RFC3339 timestamps")
return [2]time.Time{}, false
}
a, ok1 := v.extractTimestampValue(values[0])
b, ok2 := v.extractTimestampValue(values[1])
if !ok1 || !ok2 {
return [2]time.Time{}, false
}
return [2]time.Time{a, b}, true
}
func (v *visitor) extractStringValueList(ctx *grammar.ComparisonContext, keyForError string) ([]string, bool) {
var valuesCtx []grammar.IValueContext
switch {
case ctx.InClause() != nil:
inClause := ctx.InClause()
if inClause.ValueList() != nil {
valuesCtx = inClause.ValueList().AllValue()
} else {
valuesCtx = []grammar.IValueContext{inClause.Value()}
}
case ctx.NotInClause() != nil:
notInClause := ctx.NotInClause()
if notInClause.ValueList() != nil {
valuesCtx = notInClause.ValueList().AllValue()
} else {
valuesCtx = []grammar.IValueContext{notInClause.Value()}
}
default:
v.addError("IN clause is missing for %q", keyForError)
return nil, false
}
if len(valuesCtx) == 0 {
v.addError("IN list for %q is empty", keyForError)
return nil, false
}
out := make([]string, 0, len(valuesCtx))
for _, valueContext := range valuesCtx {
s, ok := v.extractStringValue(valueContext, keyForError)
if !ok {
return nil, false
}
out = append(out, s)
}
return out, true
}
func (v *visitor) extractStringValue(ctx grammar.IValueContext, keyForError string) (string, bool) {
if ctx.QUOTED_TEXT() != nil {
return trimQuotes(ctx.QUOTED_TEXT().GetText()), true
}
if ctx.KEY() != nil {
// Bare tokens are accepted as strings, mirroring the FilterQuery lexer's
// treatment of unquoted identifiers on the value side.
return ctx.KEY().GetText(), true
}
v.addError("expected a string value for %q, got %q", keyForError, ctx.GetText())
return "", false
}
func (v *visitor) extractBoolValue(ctx grammar.IValueContext) (bool, bool) {
if ctx.BOOL() == nil {
v.addError("expected a boolean (true/false), got %q", ctx.GetText())
return false, false
}
return strings.EqualFold(ctx.BOOL().GetText(), "true"), true
}
func (v *visitor) extractTimestampValue(ctx grammar.IValueContext) (time.Time, bool) {
if ctx.QUOTED_TEXT() == nil {
v.addError("expected an RFC3339 timestamp string, got %q", ctx.GetText())
return time.Time{}, false
}
raw := trimQuotes(ctx.QUOTED_TEXT().GetText())
t, err := time.Parse(time.RFC3339, raw)
if err != nil {
v.addError("invalid RFC3339 timestamp %q: %s", raw, err.Error())
return time.Time{}, false
}
return t, true
}
// ─── operator spelling ───────────────────────────────────────────────────────
// operationName returns the user-facing spelling of a FilterOperator, used only in
// error messages — go-sqlbuilder's Cond helpers emit the SQL keywords.
func operationName(operation qbtypesv5.FilterOperator) string {
switch operation {
case qbtypesv5.FilterOperatorEqual:
return "="
case qbtypesv5.FilterOperatorNotEqual:
return "!="
case qbtypesv5.FilterOperatorLessThan:
return "<"
case qbtypesv5.FilterOperatorLessThanOrEq:
return "<="
case qbtypesv5.FilterOperatorGreaterThan:
return ">"
case qbtypesv5.FilterOperatorGreaterThanOrEq:
return ">="
case qbtypesv5.FilterOperatorBetween:
return "BETWEEN"
case qbtypesv5.FilterOperatorNotBetween:
return "NOT BETWEEN"
case qbtypesv5.FilterOperatorLike:
return "LIKE"
case qbtypesv5.FilterOperatorNotLike:
return "NOT LIKE"
case qbtypesv5.FilterOperatorILike:
return "ILIKE"
case qbtypesv5.FilterOperatorNotILike:
return "NOT ILIKE"
case qbtypesv5.FilterOperatorContains:
return "CONTAINS"
case qbtypesv5.FilterOperatorNotContains:
return "NOT CONTAINS"
case qbtypesv5.FilterOperatorRegexp:
return "REGEXP"
case qbtypesv5.FilterOperatorNotRegexp:
return "NOT REGEXP"
case qbtypesv5.FilterOperatorIn:
return "IN"
case qbtypesv5.FilterOperatorNotIn:
return "NOT IN"
case qbtypesv5.FilterOperatorExists:
return "EXISTS"
case qbtypesv5.FilterOperatorNotExists:
return "NOT EXISTS"
}
return "?"
}
func trimQuotes(s string) string {
if len(s) >= 2 {
if (s[0] == '"' && s[len(s)-1] == '"') || (s[0] == '\'' && s[len(s)-1] == '\'') {
s = s[1 : len(s)-1]
}
}
s = strings.ReplaceAll(s, `\\`, `\`)
s = strings.ReplaceAll(s, `\'`, `'`)
return s
}

View File

@@ -2,7 +2,6 @@ package impldashboard
import (
"context"
"strings"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/sqlstore"
@@ -64,155 +63,6 @@ func (store *store) Get(ctx context.Context, orgID valuer.UUID, id valuer.UUID)
return storableDashboard, nil
}
// ListForUser emits the joined dashboard ⨝ user_dashboard_preference query the
// spec calls for. Aliases:
//
// dashboard — the visitor expects this
// user_dashboard_preference AS preference — only used inside this query
//
// Sort is "is_pinned DESC, <sort> <order>" so pinned dashboards float to the
// top inside the requested ordering. Name-sort goes through the same
// JSONExtractString path the visitor uses for name/description filtering.
func (store *store) ListForUser(
ctx context.Context,
orgID valuer.UUID,
userID valuer.UUID,
params *dashboardtypes.ListDashboardsV2Params,
) ([]*dashboardtypes.StorableDashboardWithPinInfo, int64, error) {
compiled, err := Compile(params.Query, store.sqlstore.Formatter())
if err != nil {
return nil, 0, err
}
type listedRow struct {
*dashboardtypes.StorableDashboard `bun:",extend"`
IsPinned bool `bun:"is_pinned"`
Total int64 `bun:"total"`
}
rows := make([]*listedRow, 0)
q := store.sqlstore.
BunDB().
NewSelect().
Model(&rows).
ColumnExpr("dashboard.id, dashboard.org_id, dashboard.name, dashboard.data, dashboard.locked, dashboard.source, dashboard.created_at, dashboard.created_by, dashboard.updated_at, dashboard.updated_by").
ColumnExpr("CASE WHEN preference.is_pinned THEN 1 ELSE 0 END AS is_pinned").
ColumnExpr("COUNT(*) OVER () AS total").
Join("LEFT JOIN user_dashboard_preference AS preference ON preference.user_id = ? AND preference.dashboard_id = dashboard.id", userID).
Where("dashboard.org_id = ?", orgID).
Where("dashboard.source != ?", dashboardtypes.SourceSystem)
if compiled != nil {
q = q.Where(compiled.SQL, compiled.Args...)
}
sortExpr, err := store.sortExprForListV2(params.Sort)
if err != nil {
return nil, 0, err
}
q = q.
OrderExpr("is_pinned DESC").
OrderExpr(sortExpr + " " + strings.ToUpper(params.Order.StringValue())).
Limit(params.Limit).
Offset(params.Offset)
if err := q.Scan(ctx); err != nil {
return nil, 0, errors.WrapInternalf(err, errors.CodeInternal, "couldn't list dashboards")
}
// COUNT(*) OVER () is computed pre-LIMIT, so any returned row carries the
// full filter total. Empty result page => zero matches.
var total int64
if len(rows) > 0 {
total = rows[0].Total
}
out := make([]*dashboardtypes.StorableDashboardWithPinInfo, len(rows))
for i, r := range rows {
out[i] = &dashboardtypes.StorableDashboardWithPinInfo{
Dashboard: r.StorableDashboard,
Pinned: r.IsPinned,
}
}
return out, total, nil
}
// ListV2 is the pure (user-independent) list: the same filter/sort/pagination as
// ListForUser, but without the per-user pin join or pin-first ordering.
func (store *store) ListV2(
ctx context.Context,
orgID valuer.UUID,
params *dashboardtypes.ListDashboardsV2Params,
) ([]*dashboardtypes.StorableDashboard, int64, error) {
compiled, err := Compile(params.Query, store.sqlstore.Formatter())
if err != nil {
return nil, 0, err
}
type listedRow struct {
*dashboardtypes.StorableDashboard `bun:",extend"`
Total int64 `bun:"total"`
}
rows := make([]*listedRow, 0)
q := store.sqlstore.
BunDB().
NewSelect().
Model(&rows).
ColumnExpr("dashboard.id, dashboard.org_id, dashboard.name, dashboard.data, dashboard.locked, dashboard.source, dashboard.created_at, dashboard.created_by, dashboard.updated_at, dashboard.updated_by").
ColumnExpr("COUNT(*) OVER () AS total").
Where("dashboard.org_id = ?", orgID).
Where("dashboard.source != ?", dashboardtypes.SourceSystem)
if compiled != nil {
q = q.Where(compiled.SQL, compiled.Args...)
}
sortExpr, err := store.sortExprForListV2(params.Sort)
if err != nil {
return nil, 0, err
}
q = q.
OrderExpr(sortExpr + " " + strings.ToUpper(params.Order.StringValue())).
Limit(params.Limit).
Offset(params.Offset)
if err := q.Scan(ctx); err != nil {
return nil, 0, errors.WrapInternalf(err, errors.CodeInternal, "couldn't list dashboards")
}
// COUNT(*) OVER () is computed pre-LIMIT, so any returned row carries the
// full filter total. Empty result page => zero matches.
var total int64
if len(rows) > 0 {
total = rows[0].Total
}
out := make([]*dashboardtypes.StorableDashboard, len(rows))
for i, r := range rows {
out[i] = r.StorableDashboard
}
return out, total, nil
}
// sortExprForListV2 maps a sort enum to the SQL expression to plug into
// ORDER BY. Title-sort routes through the SQLFormatter so it stays
// dialect-aware (matches what the filter visitor does for the name filter).
func (store *store) sortExprForListV2(sort dashboardtypes.ListSort) (string, error) {
switch sort {
case dashboardtypes.ListSortUpdatedAt:
return "dashboard.updated_at", nil
case dashboardtypes.ListSortCreatedAt:
return "dashboard.created_at", nil
case dashboardtypes.ListSortName:
return string(store.sqlstore.Formatter().JSONExtractString("dashboard.data", "$.spec.display.name")), nil
}
return "", errors.Newf(errors.TypeInvalidInput, dashboardtypes.ErrCodeDashboardListInvalid,
"unsupported sort field %q", sort)
}
func (store *store) GetPublic(ctx context.Context, dashboardID string) (*dashboardtypes.StorablePublicDashboard, error) {
storable := new(dashboardtypes.StorablePublicDashboard)
err := store.
@@ -367,82 +217,3 @@ func (store *store) RunInTx(ctx context.Context, cb func(ctx context.Context) er
return cb(ctx)
})
}
// PinForUser combines the count check, the existence check, and the upsert in
// a single statement so the limit gate and the insert can't drift between two
// round-trips. The count and existence checks gate on is_pinned = true so they
// stay correct once the row carries preferences other than the pin.
//
// pin exists? | pinned count < 10? | WHERE passes? | effect | rows
// ------------|--------------------|-------------------------|-------------------------------------|-----
// no | yes | yes (count branch) | INSERT new pinned row | 1
// no | no | no | nothing (limit hit) | 0
// yes | yes | yes (count branch) | INSERT → conflict → UPDATE is_pinned| 1
// yes | no | yes (EXISTS OR branch) | INSERT → conflict → UPDATE is_pinned| 1
//
// rows = 0 is the only signal of a real limit hit.
func (store *store) PinForUser(ctx context.Context, preference *dashboardtypes.UserDashboardPreference) error {
res, err := store.sqlstore.BunDBCtx(ctx).NewRaw(`
INSERT INTO user_dashboard_preference (user_id, dashboard_id, is_pinned)
SELECT ?, ?, true
WHERE (SELECT COUNT(*) FROM user_dashboard_preference WHERE user_id = ? AND is_pinned = true) < ?
OR EXISTS (SELECT 1 FROM user_dashboard_preference WHERE user_id = ? AND dashboard_id = ? AND is_pinned = true)
ON CONFLICT (user_id, dashboard_id) DO UPDATE SET is_pinned = true
`,
preference.UserID, preference.DashboardID,
preference.UserID, dashboardtypes.MaxPinnedDashboardsPerUser,
preference.UserID, preference.DashboardID,
).Exec(ctx)
if err != nil {
return errors.WrapInternalf(err, errors.CodeInternal, "couldn't pin dashboard for user")
}
rows, err := res.RowsAffected()
if err != nil {
return errors.WrapInternalf(err, errors.CodeInternal, "couldn't read pin result")
}
if rows == 0 {
return errors.Newf(errors.TypeAlreadyExists, dashboardtypes.ErrCodePinnedDashboardLimitHit,
"cannot pin more than %d dashboards", dashboardtypes.MaxPinnedDashboardsPerUser)
}
return nil
}
// UnpinForUser deletes the user's preference row. This is fine while is_pinned
// is the only preference stored; once the row carries other preferences this
// must become an UPDATE that clears is_pinned instead of dropping the row.
func (store *store) UnpinForUser(ctx context.Context, userID valuer.UUID, dashboardID valuer.UUID) error {
_, err := store.sqlstore.BunDBCtx(ctx).
NewDelete().
Model((*dashboardtypes.UserDashboardPreference)(nil)).
Where("user_id = ?", userID).
Where("dashboard_id = ?", dashboardID).
Exec(ctx)
if err != nil {
return errors.WrapInternalf(err, errors.CodeInternal, "couldn't unpin dashboard for user")
}
return nil
}
func (store *store) DeletePreferencesForDashboard(ctx context.Context, dashboardID valuer.UUID) error {
_, err := store.sqlstore.BunDBCtx(ctx).
NewDelete().
Model((*dashboardtypes.UserDashboardPreference)(nil)).
Where("dashboard_id = ?", dashboardID).
Exec(ctx)
if err != nil {
return errors.WrapInternalf(err, errors.CodeInternal, "couldn't delete dashboard preferences")
}
return nil
}
func (store *store) DeletePreferencesForUser(ctx context.Context, userID valuer.UUID) error {
_, err := store.sqlstore.BunDBCtx(ctx).
NewDelete().
Model((*dashboardtypes.UserDashboardPreference)(nil)).
Where("user_id = ?", userID).
Exec(ctx)
if err != nil {
return errors.WrapInternalf(err, errors.CodeInternal, "couldn't delete dashboard preferences")
}
return nil
}

View File

@@ -42,69 +42,6 @@ func (handler *handler) CreateV2(rw http.ResponseWriter, r *http.Request) {
render.Success(rw, http.StatusCreated, dashboard.ToGettableDashboardV2())
}
func (handler *handler) ListV2(rw http.ResponseWriter, r *http.Request) {
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Second)
defer cancel()
claims, err := authtypes.ClaimsFromContext(ctx)
if err != nil {
render.Error(rw, err)
return
}
orgID := valuer.MustNewUUID(claims.OrgID)
params := new(dashboardtypes.ListDashboardsV2Params)
if err := binding.Query.BindQuery(r.URL.Query(), params); err != nil {
render.Error(rw, err)
return
}
if err := params.Validate(); err != nil {
render.Error(rw, err)
return
}
out, err := handler.module.ListV2(ctx, orgID, params)
if err != nil {
render.Error(rw, err)
return
}
render.Success(rw, http.StatusOK, out)
}
func (handler *handler) ListForUserV2(rw http.ResponseWriter, r *http.Request) {
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Second)
defer cancel()
claims, err := authtypes.ClaimsFromContext(ctx)
if err != nil {
render.Error(rw, err)
return
}
orgID := valuer.MustNewUUID(claims.OrgID)
userID := valuer.MustNewUUID(claims.IdentityID())
params := new(dashboardtypes.ListDashboardsV2Params)
if err := binding.Query.BindQuery(r.URL.Query(), params); err != nil {
render.Error(rw, err)
return
}
if err := params.Validate(); err != nil {
render.Error(rw, err)
return
}
out, err := handler.module.ListForUserV2(ctx, orgID, userID, params)
if err != nil {
render.Error(rw, err)
return
}
render.Success(rw, http.StatusOK, out)
}
func (handler *handler) GetV2(rw http.ResponseWriter, r *http.Request) {
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Second)
defer cancel()
@@ -268,79 +205,3 @@ func (handler *handler) PatchV2(rw http.ResponseWriter, r *http.Request) {
render.Success(rw, http.StatusOK, dashboard.ToGettableDashboardV2())
}
func (handler *handler) PinV2(rw http.ResponseWriter, r *http.Request) {
handler.pinUnpinV2(rw, r, true)
}
func (handler *handler) UnpinV2(rw http.ResponseWriter, r *http.Request) {
handler.pinUnpinV2(rw, r, false)
}
func (handler *handler) pinUnpinV2(rw http.ResponseWriter, r *http.Request, pin bool) {
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Second)
defer cancel()
claims, err := authtypes.ClaimsFromContext(ctx)
if err != nil {
render.Error(rw, err)
return
}
orgID := valuer.MustNewUUID(claims.OrgID)
userID := valuer.MustNewUUID(claims.IdentityID())
id := mux.Vars(r)["id"]
if id == "" {
render.Error(rw, errors.Newf(errors.TypeInvalidInput, errors.CodeInvalidInput, "id is missing in the path"))
return
}
dashboardID, err := valuer.NewUUID(id)
if err != nil {
render.Error(rw, err)
return
}
if pin {
err = handler.module.PinV2(ctx, orgID, userID, dashboardID)
} else {
err = handler.module.UnpinV2(ctx, userID, dashboardID)
}
if err != nil {
render.Error(rw, err)
return
}
render.Success(rw, http.StatusNoContent, nil)
}
func (handler *handler) DeleteV2(rw http.ResponseWriter, r *http.Request) {
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Second)
defer cancel()
claims, err := authtypes.ClaimsFromContext(ctx)
if err != nil {
render.Error(rw, err)
return
}
orgID := valuer.MustNewUUID(claims.OrgID)
id := mux.Vars(r)["id"]
if id == "" {
render.Error(rw, errors.Newf(errors.TypeInvalidInput, errors.CodeInvalidInput, "id is missing in the path"))
return
}
dashboardID, err := valuer.NewUUID(id)
if err != nil {
render.Error(rw, err)
return
}
if err := handler.module.DeleteV2(ctx, orgID, dashboardID); err != nil {
render.Error(rw, err)
return
}
render.Success(rw, http.StatusNoContent, nil)
}

View File

@@ -6,7 +6,6 @@ import (
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/types/coretypes"
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
"github.com/SigNoz/signoz/pkg/types/tagtypes"
"github.com/SigNoz/signoz/pkg/valuer"
)
@@ -43,58 +42,6 @@ func (m *module) CreateV2(ctx context.Context, orgID valuer.UUID, createdBy stri
return dashboard, nil
}
func (module *module) ListV2(ctx context.Context, orgID valuer.UUID, params *dashboardtypes.ListDashboardsV2Params) (*dashboardtypes.ListableDashboardV2, error) {
dashboards, total, err := module.store.ListV2(ctx, orgID, params)
if err != nil {
return nil, err
}
dashboardIDs := make([]valuer.UUID, len(dashboards))
for i, d := range dashboards {
dashboardIDs[i] = d.ID
}
tagsByDashboard, allTags, err := module.fetchDashboardTags(ctx, orgID, dashboardIDs)
if err != nil {
return nil, err
}
return dashboardtypes.NewListableDashboardV2(dashboards, total, tagsByDashboard, allTags)
}
func (module *module) ListForUserV2(ctx context.Context, orgID valuer.UUID, userID valuer.UUID, params *dashboardtypes.ListDashboardsV2Params) (*dashboardtypes.ListableDashboardForUserV2, error) {
rows, total, err := module.store.ListForUser(ctx, orgID, userID, params)
if err != nil {
return nil, err
}
dashboardIDs := make([]valuer.UUID, len(rows))
for i, r := range rows {
dashboardIDs[i] = r.Dashboard.ID
}
tagsByDashboard, allTags, err := module.fetchDashboardTags(ctx, orgID, dashboardIDs)
if err != nil {
return nil, err
}
return dashboardtypes.NewListableDashboardForUserV2(rows, total, tagsByDashboard, allTags)
}
func (module *module) fetchDashboardTags(ctx context.Context, orgID valuer.UUID, dashboardIDs []valuer.UUID) (map[valuer.UUID][]*tagtypes.Tag, []*tagtypes.Tag, error) {
tagsByDashboard, err := module.tagModule.ListForResources(ctx, orgID, coretypes.KindDashboard, dashboardIDs)
if err != nil {
return nil, nil, err
}
allTags, err := module.tagModule.List(ctx, orgID, coretypes.KindDashboard)
if err != nil {
return nil, nil, err
}
return tagsByDashboard, allTags, nil
}
func (module *module) GetV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID) (*dashboardtypes.DashboardV2, error) {
storable, err := module.store.Get(ctx, orgID, id)
if err != nil {
@@ -188,27 +135,6 @@ func (module *module) PatchV2(ctx context.Context, orgID valuer.UUID, id valuer.
return existing, nil
}
func (module *module) DeleteV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID) error {
existing, err := module.GetV2(ctx, orgID, id)
if err != nil {
return err
}
if err := existing.CanDelete(); err != nil {
return err
}
return module.store.RunInTx(ctx, func(ctx context.Context) error {
// Syncing to an empty tag set drops every tag link for the dashboard.
if _, err := module.tagModule.SyncTags(ctx, orgID, coretypes.KindDashboard, id, nil); err != nil {
return err
}
if err := module.store.DeletePreferencesForDashboard(ctx, id); err != nil {
return err
}
return module.store.Delete(ctx, orgID, id)
})
}
func (module *module) LockUnlockV2(ctx context.Context, orgID valuer.UUID, id valuer.UUID, updatedBy string, isAdmin bool, lock bool) error {
existing, err := module.GetV2(ctx, orgID, id)
if err != nil {
@@ -223,18 +149,3 @@ func (module *module) LockUnlockV2(ctx context.Context, orgID valuer.UUID, id va
}
return module.store.Update(ctx, orgID, storable)
}
func (module *module) PinV2(ctx context.Context, orgID valuer.UUID, userID valuer.UUID, id valuer.UUID) error {
if _, err := module.GetV2(ctx, orgID, id); err != nil {
return err
}
return module.store.PinForUser(ctx, dashboardtypes.NewUserDashboardPreference(userID, id))
}
func (module *module) UnpinV2(ctx context.Context, userID valuer.UUID, id valuer.UUID) error {
return module.store.UnpinForUser(ctx, userID, id)
}
func (module *module) DeletePreferencesForUser(ctx context.Context, userID valuer.UUID) error {
return module.store.DeletePreferencesForUser(ctx, userID)
}

View File

@@ -17,8 +17,6 @@ var nodeNameGroupByKey = qbtypes.GroupByKey{
},
}
// nodesTableMetricNamesList drives the existence/retention check.
// Includes condition_ready and pod.phase also.
var nodesTableMetricNamesList = []string{
"k8s.node.cpu.usage",
"k8s.node.allocatable_cpu",

View File

@@ -67,10 +67,6 @@ func (m *module) syncLinksForResource(ctx context.Context, orgID valuer.UUID, ki
})
}
func (m *module) List(ctx context.Context, orgID valuer.UUID, kind coretypes.Kind) ([]*tagtypes.Tag, error) {
return m.store.List(ctx, orgID, kind)
}
func (m *module) ListForResource(ctx context.Context, orgID valuer.UUID, kind coretypes.Kind, resourceID valuer.UUID) ([]*tagtypes.Tag, error) {
return m.store.ListByResource(ctx, orgID, kind, resourceID)
}

View File

@@ -13,9 +13,6 @@ type Module interface {
// and reconciles the resource's links to exactly that set, all in one transaction.
SyncTags(ctx context.Context, orgID valuer.UUID, kind coretypes.Kind, resourceID valuer.UUID, postable []tagtypes.PostableTag) ([]*tagtypes.Tag, error)
// List returns every tag of the given kind in the org.
List(ctx context.Context, orgID valuer.UUID, kind coretypes.Kind) ([]*tagtypes.Tag, error)
ListForResource(ctx context.Context, orgID valuer.UUID, kind coretypes.Kind, resourceID valuer.UUID) ([]*tagtypes.Tag, error)
// Resources with no tags are absent from the returned map.

View File

@@ -13,7 +13,6 @@ import (
"github.com/SigNoz/signoz/pkg/emailing"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/factory"
"github.com/SigNoz/signoz/pkg/modules/dashboard"
"github.com/SigNoz/signoz/pkg/modules/organization"
root "github.com/SigNoz/signoz/pkg/modules/user"
"github.com/SigNoz/signoz/pkg/tokenizer"
@@ -35,11 +34,10 @@ type setter struct {
analytics analytics.Analytics
config root.Config
getter root.Getter
dashboard dashboard.Module
}
// This module is a WIP, don't take inspiration from this.
func NewSetter(store types.UserStore, tokenizer tokenizer.Tokenizer, emailing emailing.Emailing, providerSettings factory.ProviderSettings, orgSetter organization.Setter, authz authz.AuthZ, analytics analytics.Analytics, config root.Config, userRoleStore authtypes.UserRoleStore, getter root.Getter, dashboard dashboard.Module) root.Setter {
func NewSetter(store types.UserStore, tokenizer tokenizer.Tokenizer, emailing emailing.Emailing, providerSettings factory.ProviderSettings, orgSetter organization.Setter, authz authz.AuthZ, analytics analytics.Analytics, config root.Config, userRoleStore authtypes.UserRoleStore, getter root.Getter) root.Setter {
settings := factory.NewScopedProviderSettings(providerSettings, "github.com/SigNoz/signoz/pkg/modules/user/impluser")
return &setter{
store: store,
@@ -52,7 +50,6 @@ func NewSetter(store types.UserStore, tokenizer tokenizer.Tokenizer, emailing em
authz: authz,
config: config,
getter: getter,
dashboard: dashboard,
}
}
@@ -409,10 +406,6 @@ func (module *setter) DeleteUser(ctx context.Context, orgID valuer.UUID, id stri
return err
}
if err := module.dashboard.DeletePreferencesForUser(ctx, user.ID); err != nil {
return err
}
traitsOrProperties := types.NewTraitsFromUser(user)
module.analytics.IdentifyUser(ctx, user.OrgID.String(), user.ID.String(), traitsOrProperties)
module.analytics.TrackUser(ctx, user.OrgID.String(), user.ID.String(), "User Deleted", map[string]any{

View File

@@ -1,33 +0,0 @@
package filterquery
import (
"fmt"
grammar "github.com/SigNoz/signoz/pkg/parser/filterquery/grammar"
"github.com/antlr4-go/antlr/v4"
)
func Parse(query string) (antlr.ParseTree, *antlr.CommonTokenStream, *ErrorCollector) {
collector := NewErrorCollector()
lexer := grammar.NewFilterQueryLexer(antlr.NewInputStream(query))
lexer.RemoveErrorListeners()
lexer.AddErrorListener(collector)
tokens := antlr.NewCommonTokenStream(lexer, 0)
parser := grammar.NewFilterQueryParser(tokens)
parser.RemoveErrorListeners()
parser.AddErrorListener(collector)
return parser.Query(), tokens, collector
}
type ErrorCollector struct {
*antlr.DefaultErrorListener
Errors []string
}
func NewErrorCollector() *ErrorCollector {
return &ErrorCollector{}
}
func (c *ErrorCollector) SyntaxError(_ antlr.Recognizer, _ any, line, column int, msg string, _ antlr.RecognitionException) {
c.Errors = append(c.Errors, fmt.Sprintf("syntax error at %d:%d — %s", line, column, msg))
}

View File

@@ -361,10 +361,6 @@ func (q *querier) resolveMetricMetadata(ctx context.Context, queries []qbtypes.Q
missingMetrics = append(missingMetrics, spec.Aggregations[i].MetricName)
continue
}
// Type is resolved now; validate aggregation compatibility against it.
if err := spec.Aggregations[i].ValidateForType(); err != nil {
return nil, "", err
}
presentAggregations = append(presentAggregations, spec.Aggregations[i])
}
if len(presentAggregations) == 0 {

View File

@@ -49,6 +49,8 @@ import (
"github.com/SigNoz/signoz/pkg/querier"
"github.com/SigNoz/signoz/pkg/ruler"
"github.com/SigNoz/signoz/pkg/ruler/signozruler"
"github.com/SigNoz/signoz/pkg/statsreporter"
"github.com/SigNoz/signoz/pkg/telemetrystore"
"github.com/SigNoz/signoz/pkg/types/telemetrytypes"
"github.com/SigNoz/signoz/pkg/zeus"
)
@@ -80,6 +82,7 @@ type Handlers struct {
TraceDetail tracedetail.Handler
RulerHandler ruler.Handler
LLMPricingRuleHandler llmpricingrule.Handler
StatsReporter statsreporter.Handler
}
func NewHandlers(
@@ -97,6 +100,7 @@ func NewHandlers(
registryHandler factory.Handler,
alertmanagerService alertmanager.Alertmanager,
rulerService ruler.Ruler,
telemetryStore telemetrystore.TelemetryStore,
) Handlers {
return Handlers{
SavedView: implsavedview.NewHandler(modules.SavedView),
@@ -125,5 +129,11 @@ func NewHandlers(
TraceDetail: impltracedetail.NewHandler(modules.TraceDetail),
RulerHandler: signozruler.NewHandler(rulerService),
LLMPricingRuleHandler: impllmpricingrule.NewHandler(modules.LLMPricingRule),
StatsReporter: statsreporter.NewHandler(telemetryStore, statsreporter.OrgContextCollectors{
Rules: rulerService,
Dashboards: modules.Dashboard,
SavedViews: modules.SavedView,
Licensing: licensing,
}),
}
}

View File

@@ -63,7 +63,7 @@ func TestNewHandlers(t *testing.T) {
querierHandler := querier.NewHandler(providerSettings, nil, nil)
registryHandler := factory.NewHandler(nil)
handlers := NewHandlers(modules, providerSettings, nil, querierHandler, nil, nil, nil, nil, nil, nil, nil, registryHandler, alertmanager, nil)
handlers := NewHandlers(modules, providerSettings, nil, querierHandler, nil, nil, nil, nil, nil, nil, nil, registryHandler, alertmanager, nil, nil)
reflectVal := reflect.ValueOf(handlers)
for i := 0; i < reflectVal.NumField(); i++ {
f := reflectVal.Field(i)

View File

@@ -122,7 +122,7 @@ func NewModules(
) Modules {
quickfilter := implquickfilter.NewModule(implquickfilter.NewStore(sqlstore))
orgSetter := implorganization.NewSetter(implorganization.NewStore(sqlstore), alertmanager, quickfilter)
userSetter := impluser.NewSetter(impluser.NewStore(sqlstore, providerSettings), tokenizer, emailing, providerSettings, orgSetter, authz, analytics, config.User, userRoleStore, userGetter, dashboard)
userSetter := impluser.NewSetter(impluser.NewStore(sqlstore, providerSettings), tokenizer, emailing, providerSettings, orgSetter, authz, analytics, config.User, userRoleStore, userGetter)
ruleStore := sqlrulestore.NewRuleStore(sqlstore, queryParser, providerSettings)
return Modules{

View File

@@ -36,6 +36,7 @@ import (
"github.com/SigNoz/signoz/pkg/modules/user"
"github.com/SigNoz/signoz/pkg/querier"
"github.com/SigNoz/signoz/pkg/ruler"
"github.com/SigNoz/signoz/pkg/statsreporter"
"github.com/SigNoz/signoz/pkg/types/authtypes"
"github.com/SigNoz/signoz/pkg/zeus"
"github.com/swaggest/jsonschema-go"
@@ -70,6 +71,7 @@ func NewOpenAPI(ctx context.Context, instrumentation instrumentation.Instrumenta
struct{ inframonitoring.Handler }{},
struct{ gateway.Handler }{},
struct{ fields.Handler }{},
struct{ statsreporter.Handler }{},
struct{ authz.Handler }{},
struct{ rawdataexport.Handler }{},
struct{ zeus.Handler }{},

View File

@@ -211,7 +211,6 @@ func NewSQLMigrationProviderFactories(
sqlmigration.NewAddDashboardNameFactory(sqlstore, sqlschema),
sqlmigration.NewFixChangelogOperationTypeFactory(sqlstore, sqlschema),
sqlmigration.NewCloudIntegrationRemoveCascadeDeleteFactory(sqlschema),
sqlmigration.NewAddUserDashboardPreferenceFactory(sqlstore, sqlschema),
)
}
@@ -263,9 +262,9 @@ func NewSharderProviderFactories() factory.NamedMap[factory.ProviderFactory[shar
)
}
func NewStatsReporterProviderFactories(telemetryStore telemetrystore.TelemetryStore, collectors []statsreporter.StatsCollector, orgGetter organization.Getter, userGetter user.Getter, tokenizer tokenizer.Tokenizer, build version.Build, analyticsConfig analytics.Config) factory.NamedMap[factory.ProviderFactory[statsreporter.StatsReporter, statsreporter.Config]] {
func NewStatsReporterProviderFactories(collectors []statsreporter.StatsCollector, orgGetter organization.Getter, userGetter user.Getter, tokenizer tokenizer.Tokenizer, build version.Build, analyticsConfig analytics.Config) factory.NamedMap[factory.ProviderFactory[statsreporter.StatsReporter, statsreporter.Config]] {
return factory.MustNewNamedMap(
analyticsstatsreporter.NewFactory(telemetryStore, collectors, orgGetter, userGetter, tokenizer, build, analyticsConfig),
analyticsstatsreporter.NewFactory(collectors, orgGetter, userGetter, tokenizer, build, analyticsConfig),
noopstatsreporter.NewFactory(),
)
}
@@ -295,6 +294,7 @@ func NewAPIServerProviderFactories(orgGetter organization.Getter, authz authz.Au
handlers.InfraMonitoring,
handlers.GatewayHandler,
handlers.Fields,
handlers.StatsReporter,
handlers.AuthzHandler,
handlers.RawDataExport,
handlers.ZeusHandler,

View File

@@ -85,8 +85,7 @@ func TestNewProviderFactories(t *testing.T) {
userGetter := impluser.NewGetter(impluser.NewStore(sqlstoretest.New(sqlstore.Config{Provider: "sqlite"}, sqlmock.QueryMatcherEqual), instrumentationtest.New().ToProviderSettings()), userRoleStore, flagger)
orgGetter := implorganization.NewGetter(implorganization.NewStore(sqlstoretest.New(sqlstore.Config{Provider: "sqlite"}, sqlmock.QueryMatcherEqual)), nil)
telemetryStore := telemetrystoretest.New(telemetrystore.Config{Provider: "clickhouse"}, sqlmock.QueryMatcherEqual)
NewStatsReporterProviderFactories(telemetryStore, []statsreporter.StatsCollector{}, orgGetter, userGetter, tokenizertest.NewMockTokenizer(t), version.Build{}, analytics.Config{Enabled: true})
NewStatsReporterProviderFactories([]statsreporter.StatsCollector{}, orgGetter, userGetter, tokenizertest.NewMockTokenizer(t), version.Build{}, analytics.Config{Enabled: true})
})
assert.NotPanics(t, func() {

View File

@@ -499,6 +499,7 @@ func New(
serviceAccount,
cloudIntegrationModule,
modules.LogsPipeline,
statsreporter.NewTelemetryStatsCollector(telemetrystore),
}
// Initialize stats reporter from the available stats reporter provider factories
@@ -506,7 +507,7 @@ func New(
ctx,
providerSettings,
config.StatsReporter,
NewStatsReporterProviderFactories(telemetrystore, statsCollectors, orgGetter, userGetter, tokenizer, version.Info, config.Analytics),
NewStatsReporterProviderFactories(statsCollectors, orgGetter, userGetter, tokenizer, version.Info, config.Analytics),
config.StatsReporter.Provider(),
)
if err != nil {
@@ -535,7 +536,7 @@ func New(
// Initialize all handlers for the modules
registryHandler := factory.NewHandler(registry)
handlers := NewHandlers(modules, providerSettings, analytics, querierHandler, licensing, global, flagger, gateway, telemetryMetadataStore, authz, zeus, registryHandler, alertmanager, rulerInstance)
handlers := NewHandlers(modules, providerSettings, analytics, querierHandler, licensing, global, flagger, gateway, telemetryMetadataStore, authz, zeus, registryHandler, alertmanager, rulerInstance, telemetrystore)
// Initialize the API server (after registry so it can access service health)
apiserverInstance, err := factory.NewProviderFromNamedMap(

View File

@@ -1,71 +0,0 @@
package sqlmigration
import (
"context"
"github.com/SigNoz/signoz/pkg/factory"
"github.com/SigNoz/signoz/pkg/sqlschema"
"github.com/SigNoz/signoz/pkg/sqlstore"
"github.com/uptrace/bun"
"github.com/uptrace/bun/migrate"
)
type addUserDashboardPreference struct {
sqlstore sqlstore.SQLStore
sqlschema sqlschema.SQLSchema
}
func NewAddUserDashboardPreferenceFactory(sqlstore sqlstore.SQLStore, sqlschema sqlschema.SQLSchema) factory.ProviderFactory[SQLMigration, Config] {
return factory.NewProviderFactory(factory.MustNewName("add_user_dashboard_preference"), func(ctx context.Context, ps factory.ProviderSettings, c Config) (SQLMigration, error) {
return &addUserDashboardPreference{
sqlstore: sqlstore,
sqlschema: sqlschema,
}, nil
})
}
func (migration *addUserDashboardPreference) Register(migrations *migrate.Migrations) error {
return migrations.Register(migration.Up, migration.Down)
}
func (migration *addUserDashboardPreference) Up(ctx context.Context, db *bun.DB) error {
tx, err := db.BeginTx(ctx, nil)
if err != nil {
return err
}
defer func() { _ = tx.Rollback() }()
sqls := migration.sqlschema.Operator().CreateTable(&sqlschema.Table{
Name: "user_dashboard_preference",
Columns: []*sqlschema.Column{
{Name: "user_id", DataType: sqlschema.DataTypeText, Nullable: false},
{Name: "dashboard_id", DataType: sqlschema.DataTypeText, Nullable: false},
{Name: "is_pinned", DataType: sqlschema.DataTypeBoolean, Nullable: false, Default: "false"},
},
PrimaryKeyConstraint: &sqlschema.PrimaryKeyConstraint{ColumnNames: []sqlschema.ColumnName{"user_id", "dashboard_id"}},
ForeignKeyConstraints: []*sqlschema.ForeignKeyConstraint{
{
ReferencingColumnName: sqlschema.ColumnName("user_id"),
ReferencedTableName: sqlschema.TableName("users"),
ReferencedColumnName: sqlschema.ColumnName("id"),
},
{
ReferencingColumnName: sqlschema.ColumnName("dashboard_id"),
ReferencedTableName: sqlschema.TableName("dashboard"),
ReferencedColumnName: sqlschema.ColumnName("id"),
},
},
})
for _, sql := range sqls {
if _, err := tx.ExecContext(ctx, string(sql)); err != nil {
return err
}
}
return tx.Commit()
}
func (migration *addUserDashboardPreference) Down(_ context.Context, _ *bun.DB) error {
return nil
}

View File

@@ -16,7 +16,6 @@ import (
"github.com/SigNoz/signoz/pkg/modules/organization"
"github.com/SigNoz/signoz/pkg/modules/user"
"github.com/SigNoz/signoz/pkg/statsreporter"
"github.com/SigNoz/signoz/pkg/telemetrystore"
"github.com/SigNoz/signoz/pkg/tokenizer"
"github.com/SigNoz/signoz/pkg/types"
"github.com/SigNoz/signoz/pkg/types/ctxtypes"
@@ -32,9 +31,6 @@ type provider struct {
// config
config statsreporter.Config
// used to get telemetry details. srikanthcvv to move this to the querier layer
telemetryStore telemetrystore.TelemetryStore
// a list of collectors, used to collect stats from across the codebase
collectors []statsreporter.StatsCollector
@@ -60,9 +56,9 @@ type provider struct {
stopC chan struct{}
}
func NewFactory(telemetryStore telemetrystore.TelemetryStore, collectors []statsreporter.StatsCollector, orgGetter organization.Getter, userGetter user.Getter, tokenizer tokenizer.Tokenizer, build version.Build, analyticsConfig analytics.Config) factory.ProviderFactory[statsreporter.StatsReporter, statsreporter.Config] {
func NewFactory(collectors []statsreporter.StatsCollector, orgGetter organization.Getter, userGetter user.Getter, tokenizer tokenizer.Tokenizer, build version.Build, analyticsConfig analytics.Config) factory.ProviderFactory[statsreporter.StatsReporter, statsreporter.Config] {
return factory.NewProviderFactory(factory.MustNewName("analytics"), func(ctx context.Context, settings factory.ProviderSettings, config statsreporter.Config) (statsreporter.StatsReporter, error) {
return New(ctx, settings, config, telemetryStore, collectors, orgGetter, userGetter, tokenizer, build, analyticsConfig)
return New(ctx, settings, config, collectors, orgGetter, userGetter, tokenizer, build, analyticsConfig)
})
}
@@ -70,7 +66,6 @@ func New(
ctx context.Context,
providerSettings factory.ProviderSettings,
config statsreporter.Config,
telemetryStore telemetrystore.TelemetryStore,
collectors []statsreporter.StatsCollector,
orgGetter organization.Getter,
userGetter user.Getter,
@@ -86,17 +81,16 @@ func New(
}
return &provider{
settings: settings,
config: config,
telemetryStore: telemetryStore,
collectors: collectors,
orgGetter: orgGetter,
userGetter: userGetter,
analytics: analytics,
tokenizer: tokenizer,
build: build,
deployment: deployment,
stopC: make(chan struct{}),
settings: settings,
config: config,
collectors: collectors,
orgGetter: orgGetter,
userGetter: userGetter,
analytics: analytics,
tokenizer: tokenizer,
build: build,
deployment: deployment,
stopC: make(chan struct{}),
}, nil
}
@@ -235,44 +229,5 @@ func (provider *provider) collectOrg(ctx context.Context, orgID valuer.UUID) map
}
wg.Wait()
var traces uint64
if err := provider.telemetryStore.ClickhouseDB().QueryRow(ctx, "SELECT COUNT(*) FROM signoz_traces.distributed_signoz_index_v3").Scan(&traces); err == nil {
stats["telemetry.traces.count"] = traces
}
var logs uint64
if err := provider.telemetryStore.ClickhouseDB().QueryRow(ctx, "SELECT COUNT(*) FROM signoz_logs.distributed_logs_v2").Scan(&logs); err == nil {
stats["telemetry.logs.count"] = logs
}
var metrics uint64
if err := provider.telemetryStore.ClickhouseDB().QueryRow(ctx, "SELECT COUNT(*) FROM signoz_metrics.distributed_samples_v4").Scan(&metrics); err == nil {
stats["telemetry.metrics.count"] = metrics
}
var tracesLastSeenAt time.Time
if err := provider.telemetryStore.ClickhouseDB().QueryRow(ctx, "SELECT max(timestamp) FROM signoz_traces.distributed_signoz_index_v3").Scan(&tracesLastSeenAt); err == nil {
if tracesLastSeenAt.Unix() != 0 {
stats["telemetry.traces.last_observed.time"] = tracesLastSeenAt.UTC()
stats["telemetry.traces.last_observed.time_unix"] = tracesLastSeenAt.Unix()
}
}
var logsLastSeenAt time.Time
if err := provider.telemetryStore.ClickhouseDB().QueryRow(ctx, "SELECT fromUnixTimestamp64Nano(max(timestamp)) FROM signoz_logs.distributed_logs_v2").Scan(&logsLastSeenAt); err == nil {
if logsLastSeenAt.Unix() != 0 {
stats["telemetry.logs.last_observed.time"] = logsLastSeenAt.UTC()
stats["telemetry.logs.last_observed.time_unix"] = logsLastSeenAt.Unix()
}
}
var metricsLastSeenAt time.Time
if err := provider.telemetryStore.ClickhouseDB().QueryRow(ctx, "SELECT toDateTime(max(unix_milli) / 1000) FROM signoz_metrics.distributed_samples_v4").Scan(&metricsLastSeenAt); err == nil {
if metricsLastSeenAt.Unix() != 0 {
stats["telemetry.metrics.last_observed.time"] = metricsLastSeenAt.UTC()
stats["telemetry.metrics.last_observed.time_unix"] = metricsLastSeenAt.Unix()
}
}
return stats
}

View File

@@ -0,0 +1,200 @@
package statsreporter
import (
"context"
"net/http"
"strings"
"time"
"golang.org/x/sync/errgroup"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/http/render"
"github.com/SigNoz/signoz/pkg/telemetrystore"
"github.com/SigNoz/signoz/pkg/types/authtypes"
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
"github.com/SigNoz/signoz/pkg/types/emptystatetypes"
"github.com/SigNoz/signoz/pkg/types/licensetypes"
"github.com/SigNoz/signoz/pkg/types/ruletypes"
"github.com/SigNoz/signoz/pkg/types/savedviewtypes"
"github.com/SigNoz/signoz/pkg/valuer"
)
type Handler interface {
GetOrgContext(rw http.ResponseWriter, req *http.Request)
}
// OrgContextCollectors are the collectors the org context signals are sourced from.
type OrgContextCollectors struct {
Rules StatsCollector
Dashboards StatsCollector
SavedViews StatsCollector
Licensing StatsCollector
}
type handler struct {
telemetryStore telemetrystore.TelemetryStore
collectors OrgContextCollectors
}
func NewHandler(telemetryStore telemetrystore.TelemetryStore, collectors OrgContextCollectors) Handler {
return &handler{
telemetryStore: telemetryStore,
collectors: collectors,
}
}
func (h *handler) GetOrgContext(rw http.ResponseWriter, req *http.Request) {
claims, err := authtypes.ClaimsFromContext(req.Context())
if err != nil {
render.Error(rw, err)
return
}
orgContext, err := h.getOrgContext(req.Context(), valuer.MustNewUUID(claims.OrgID))
if err != nil {
render.Error(rw, err)
return
}
render.Success(rw, http.StatusOK, orgContext)
}
func (h *handler) getOrgContext(ctx context.Context, orgID valuer.UUID) (*emptystatetypes.OrgContext, error) {
var logsLastIngestedAt *time.Time
var tracesLastIngestedAt *time.Time
var metricsLastIngestedAt *time.Time
var alertsCount int
var dashboardsCount int
var savedViewsCount int
licenseStatus := emptystatetypes.LicenseStatusUnknown
g, gCtx := errgroup.WithContext(ctx)
g.Go(func() error {
lastIngestedAt, err := lastObservedLogs(gCtx, h.telemetryStore)
if err != nil {
return err
}
logsLastIngestedAt = lastIngestedAt
return nil
})
g.Go(func() error {
lastIngestedAt, err := lastObservedTraces(gCtx, h.telemetryStore)
if err != nil {
return err
}
tracesLastIngestedAt = lastIngestedAt
return nil
})
g.Go(func() error {
lastIngestedAt, err := lastObservedMetrics(gCtx, h.telemetryStore)
if err != nil {
return err
}
metricsLastIngestedAt = lastIngestedAt
return nil
})
g.Go(func() error {
var err error
alertsCount, err = h.getCollectedCount(gCtx, h.collectors.Rules, ruletypes.StatKeyRuleCount, orgID)
if err != nil {
return err
}
return nil
})
g.Go(func() error {
var err error
dashboardsCount, err = h.getCollectedCount(gCtx, h.collectors.Dashboards, dashboardtypes.StatKeyDashboardCount, orgID)
if err != nil {
return err
}
return nil
})
g.Go(func() error {
var err error
savedViewsCount, err = h.getCollectedCount(gCtx, h.collectors.SavedViews, savedviewtypes.StatKeySavedViewCount, orgID)
if err != nil {
return err
}
return nil
})
g.Go(func() error {
licenseStatus = h.getLicenseStatus(gCtx, orgID)
return nil
})
if err := g.Wait(); err != nil {
return nil, err
}
lastIngestedAt := emptystatetypes.LastIngestedAt{
Logs: logsLastIngestedAt,
Traces: tracesLastIngestedAt,
Metrics: metricsLastIngestedAt,
}
return &emptystatetypes.OrgContext{
HasIngestedData: lastIngestedAt.Logs != nil || lastIngestedAt.Traces != nil || lastIngestedAt.Metrics != nil,
LastIngestedAt: lastIngestedAt,
AlertsCount: alertsCount,
DashboardsCount: dashboardsCount,
SavedViewsCount: savedViewsCount,
LicenseStatus: licenseStatus,
}, nil
}
func (h *handler) getCollectedCount(ctx context.Context, collector StatsCollector, key string, orgID valuer.UUID) (int, error) {
if collector == nil {
return 0, errors.NewInternalf(errors.CodeInternal, "collector for %q is not configured", key)
}
stats, err := collector.Collect(ctx, orgID)
if err != nil {
return 0, errors.WrapInternalf(err, errors.CodeInternal, "failed to collect %q", key)
}
count, ok := stats[key].(int64)
if !ok {
return 0, errors.NewInternalf(errors.CodeInternal, "stat %q is missing from collector output", key)
}
return int(count), nil
}
// License stats degrade to UNKNOWN: community wires nooplicensing (empty stats)
// and a licensing outage must not fail the endpoint.
func (h *handler) getLicenseStatus(ctx context.Context, orgID valuer.UUID) emptystatetypes.LicenseStatus {
if h.collectors.Licensing == nil {
return emptystatetypes.LicenseStatusUnknown
}
stats, err := h.collectors.Licensing.Collect(ctx, orgID)
if err != nil {
return emptystatetypes.LicenseStatusUnknown
}
return licenseStatusFromStats(stats)
}
func licenseStatusFromStats(stats map[string]any) emptystatetypes.LicenseStatus {
state, ok := stats[licensetypes.StatKeyLicenseStateName].(string)
if !ok || strings.TrimSpace(state) == "" {
return emptystatetypes.LicenseStatusUnknown
}
// Verbatim passthrough: trimming above is only for blank detection.
return emptystatetypes.LicenseStatus(state)
}

View File

@@ -0,0 +1,268 @@
package statsreporter
import (
"context"
"regexp"
"testing"
"time"
"github.com/DATA-DOG/go-sqlmock"
cmock "github.com/SigNoz/clickhouse-go-mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/SigNoz/signoz/pkg/telemetrystore"
"github.com/SigNoz/signoz/pkg/telemetrystore/telemetrystoretest"
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
"github.com/SigNoz/signoz/pkg/types/emptystatetypes"
"github.com/SigNoz/signoz/pkg/types/licensetypes"
"github.com/SigNoz/signoz/pkg/types/ruletypes"
"github.com/SigNoz/signoz/pkg/types/savedviewtypes"
"github.com/SigNoz/signoz/pkg/valuer"
)
var testOrgID = valuer.MustNewUUID("00000000-0000-0000-0000-000000000001")
// Exact SQL the query builders must generate; mock expectations match on these
// so any change to the statements fails the suite.
const (
logsLastObservedSQL = "SELECT fromUnixTimestamp64Nano(max(timestamp)) FROM signoz_logs.distributed_logs_v2"
tracesLastObservedSQL = "SELECT max(timestamp) FROM signoz_traces.distributed_signoz_index_v3"
metricsLastObservedSQL = "SELECT toDateTime(max(unix_milli) / 1000) FROM signoz_metrics.distributed_samples_v4"
)
type fakeCollector struct {
stats map[string]any
err error
}
func (f *fakeCollector) Collect(context.Context, valuer.UUID) (map[string]any, error) {
return f.stats, f.err
}
func okCollectors() OrgContextCollectors {
return OrgContextCollectors{
Rules: &fakeCollector{stats: map[string]any{ruletypes.StatKeyRuleCount: int64(0)}},
Dashboards: &fakeCollector{stats: map[string]any{dashboardtypes.StatKeyDashboardCount: int64(0)}},
SavedViews: &fakeCollector{stats: map[string]any{savedviewtypes.StatKeySavedViewCount: int64(0)}},
Licensing: &fakeCollector{stats: map[string]any{}},
}
}
func TestLicenseStatusFromStats(t *testing.T) {
cases := []struct {
name string
stats map[string]any
want emptystatetypes.LicenseStatus
}{
{
name: "known state passes through",
stats: map[string]any{licensetypes.StatKeyLicenseStateName: "ACTIVATED"},
want: emptystatetypes.LicenseStatus("ACTIVATED"),
},
{
name: "novel state passes through",
stats: map[string]any{licensetypes.StatKeyLicenseStateName: "FUTURE_STATE"},
want: emptystatetypes.LicenseStatus("FUTURE_STATE"),
},
{
name: "missing key returns unknown",
stats: map[string]any{},
want: emptystatetypes.LicenseStatusUnknown,
},
{
name: "blank state returns unknown",
stats: map[string]any{licensetypes.StatKeyLicenseStateName: " "},
want: emptystatetypes.LicenseStatusUnknown,
},
{
name: "non-string state returns unknown",
stats: map[string]any{licensetypes.StatKeyLicenseStateName: 42},
want: emptystatetypes.LicenseStatusUnknown,
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
status := licenseStatusFromStats(tc.stats)
assert.Equal(t, tc.want, status)
})
}
}
func TestGetLicenseStatusDegradesToUnknown(t *testing.T) {
t.Run("collector error", func(t *testing.T) {
h := &handler{collectors: OrgContextCollectors{Licensing: &fakeCollector{err: assert.AnError}}}
status := h.getLicenseStatus(context.Background(), testOrgID)
assert.Equal(t, emptystatetypes.LicenseStatusUnknown, status)
})
t.Run("nil collector", func(t *testing.T) {
h := &handler{}
status := h.getLicenseStatus(context.Background(), testOrgID)
assert.Equal(t, emptystatetypes.LicenseStatusUnknown, status)
})
}
func TestGetCollectedCount(t *testing.T) {
h := &handler{}
t.Run("missing key fails", func(t *testing.T) {
_, err := h.getCollectedCount(context.Background(), &fakeCollector{stats: map[string]any{}}, ruletypes.StatKeyRuleCount, testOrgID)
assert.Error(t, err)
})
t.Run("nil collector fails", func(t *testing.T) {
_, err := h.getCollectedCount(context.Background(), nil, ruletypes.StatKeyRuleCount, testOrgID)
assert.Error(t, err)
})
}
func TestGetOrgContextDerivesAggregates(t *testing.T) {
lastIngested := time.Unix(5000, 0).UTC()
cases := []struct {
name string
logs bool
traces bool
metrics bool
}{
{name: "logs only", logs: true},
{name: "traces only", traces: true},
{name: "metrics only", metrics: true},
{name: "nothing ingested"},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
h, chMock := newOrgContextTestHandler(t, OrgContextCollectors{
Rules: &fakeCollector{stats: map[string]any{ruletypes.StatKeyRuleCount: int64(2)}},
Dashboards: &fakeCollector{stats: map[string]any{dashboardtypes.StatKeyDashboardCount: int64(1)}},
SavedViews: &fakeCollector{stats: map[string]any{savedviewtypes.StatKeySavedViewCount: int64(3)}},
Licensing: &fakeCollector{stats: map[string]any{licensetypes.StatKeyLicenseStateName: "ACTIVATED"}},
})
if tc.logs {
expectLogsLastIngested(chMock, lastIngested)
} else {
expectLogsLastIngested(chMock, time.Time{})
}
if tc.traces {
expectTracesLastIngested(chMock, lastIngested)
} else {
expectTracesLastIngested(chMock, time.Time{})
}
if tc.metrics {
expectMetricsLastIngested(chMock, lastIngested)
} else {
expectMetricsLastIngested(chMock, time.Time{})
}
orgContext, err := h.getOrgContext(context.Background(), testOrgID)
require.NoError(t, err)
assert.Equal(t, tc.logs || tc.traces || tc.metrics, orgContext.HasIngestedData)
assertLastIngested(t, tc.logs, orgContext.LastIngestedAt.Logs, lastIngested)
assertLastIngested(t, tc.traces, orgContext.LastIngestedAt.Traces, lastIngested)
assertLastIngested(t, tc.metrics, orgContext.LastIngestedAt.Metrics, lastIngested)
assert.Equal(t, 2, orgContext.AlertsCount)
assert.Equal(t, 1, orgContext.DashboardsCount)
assert.Equal(t, 3, orgContext.SavedViewsCount)
assert.Equal(t, emptystatetypes.LicenseStatus("ACTIVATED"), orgContext.LicenseStatus)
assert.NoError(t, chMock.ExpectationsWereMet())
})
}
}
func assertLastIngested(t *testing.T, ingested bool, got *time.Time, want time.Time) {
t.Helper()
if !ingested {
assert.Nil(t, got)
return
}
require.NotNil(t, got)
assert.Equal(t, want, *got)
}
func TestGetOrgContextLicenseErrorDoesNotFail(t *testing.T) {
collectors := okCollectors()
collectors.Licensing = &fakeCollector{err: assert.AnError}
h, chMock := newOrgContextTestHandler(t, collectors)
expectTelemetryQuiet(chMock)
orgContext, err := h.getOrgContext(context.Background(), testOrgID)
require.NoError(t, err)
assert.Equal(t, emptystatetypes.LicenseStatusUnknown, orgContext.LicenseStatus)
assert.NoError(t, chMock.ExpectationsWereMet())
}
func TestGetOrgContextCollectorErrorFails(t *testing.T) {
collectors := okCollectors()
collectors.Rules = &fakeCollector{err: assert.AnError}
h, chMock := newOrgContextTestHandler(t, collectors)
expectTelemetryQuiet(chMock)
orgContext, err := h.getOrgContext(context.Background(), testOrgID)
assert.Error(t, err)
assert.Nil(t, orgContext)
}
func TestGetOrgContextClickHouseErrorFails(t *testing.T) {
h, chMock := newOrgContextTestHandler(t, okCollectors())
chMock.ExpectQueryRow(regexp.QuoteMeta(logsLastObservedSQL)).
WillReturnRow(cmock.NewRow([]cmock.ColumnType{{Name: "max(timestamp)", Type: "DateTime64(9)"}}, nil)).
WillReturnError(assert.AnError)
expectTracesLastIngested(chMock, time.Time{})
expectMetricsLastIngested(chMock, time.Time{})
orgContext, err := h.getOrgContext(context.Background(), testOrgID)
assert.Error(t, err)
assert.Nil(t, orgContext)
}
func newOrgContextTestHandler(t *testing.T, collectors OrgContextCollectors) (*handler, cmock.ClickConnMockCommon) {
t.Helper()
ts := telemetrystoretest.New(telemetrystore.Config{}, sqlmock.QueryMatcherRegexp)
ts.Mock().MatchExpectationsInOrder(false)
return &handler{
telemetryStore: ts,
collectors: collectors,
}, ts.Mock()
}
func expectTelemetryQuiet(mock cmock.ClickConnMockCommon) {
expectLogsLastIngested(mock, time.Time{})
expectTracesLastIngested(mock, time.Time{})
expectMetricsLastIngested(mock, time.Time{})
}
func expectLogsLastIngested(mock cmock.ClickConnMockCommon, lastIngestedAt time.Time) {
mock.ExpectQueryRow(regexp.QuoteMeta(logsLastObservedSQL)).
WillReturnRow(cmock.NewRow([]cmock.ColumnType{{Name: "max(timestamp)", Type: "DateTime64(9)"}}, []any{lastIngestedAt}))
}
func expectTracesLastIngested(mock cmock.ClickConnMockCommon, lastIngestedAt time.Time) {
mock.ExpectQueryRow(regexp.QuoteMeta(tracesLastObservedSQL)).
WillReturnRow(cmock.NewRow([]cmock.ColumnType{{Name: "max(timestamp)", Type: "DateTime64(9)"}}, []any{lastIngestedAt}))
}
func expectMetricsLastIngested(mock cmock.ClickConnMockCommon, lastIngestedAt time.Time) {
mock.ExpectQueryRow(regexp.QuoteMeta(metricsLastObservedSQL)).
WillReturnRow(cmock.NewRow([]cmock.ColumnType{{Name: "toDateTime(divide(max(unix_milli), 1000))", Type: "DateTime"}}, []any{lastIngestedAt}))
}

View File

@@ -0,0 +1,50 @@
package statsreporter
import (
"context"
"database/sql"
"fmt"
"time"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/telemetrylogs"
"github.com/SigNoz/signoz/pkg/telemetrymetrics"
"github.com/SigNoz/signoz/pkg/telemetrystore"
"github.com/SigNoz/signoz/pkg/telemetrytraces"
)
// Last-observed queries match the previous analytics provider queries. They are
// deployment-scoped since telemetry tables have no org column.
func lastObservedLogs(ctx context.Context, telemetryStore telemetrystore.TelemetryStore) (*time.Time, error) {
query := fmt.Sprintf("SELECT fromUnixTimestamp64Nano(max(timestamp)) FROM %s.%s", telemetrylogs.DBName, telemetrylogs.LogsV2TableName)
return scanLastObserved(ctx, telemetryStore, "logs", query)
}
func lastObservedTraces(ctx context.Context, telemetryStore telemetrystore.TelemetryStore) (*time.Time, error) {
query := fmt.Sprintf("SELECT max(timestamp) FROM %s.%s", telemetrytraces.DBName, telemetrytraces.SpanIndexV3TableName)
return scanLastObserved(ctx, telemetryStore, "traces", query)
}
func lastObservedMetrics(ctx context.Context, telemetryStore telemetrystore.TelemetryStore) (*time.Time, error) {
query := fmt.Sprintf("SELECT toDateTime(max(unix_milli) / 1000) FROM %s.%s", telemetrymetrics.DBName, telemetrymetrics.SamplesV4TableName)
return scanLastObserved(ctx, telemetryStore, "metrics", query)
}
func scanLastObserved(ctx context.Context, telemetryStore telemetrystore.TelemetryStore, signal string, query string, args ...any) (*time.Time, error) {
var lastObserved time.Time
err := telemetryStore.ClickhouseDB().QueryRow(ctx, query, args...).Scan(&lastObserved)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, nil //nolint:nilnil
}
return nil, errors.WrapInternalf(err, errors.CodeInternal, "failed to check %s last observed", signal)
}
if lastObserved.Unix() <= 0 {
return nil, nil //nolint:nilnil
}
lastObservedAt := lastObserved.UTC()
return &lastObservedAt, nil
}

View File

@@ -0,0 +1,58 @@
package statsreporter
import (
"context"
"github.com/SigNoz/signoz/pkg/telemetrystore"
"github.com/SigNoz/signoz/pkg/valuer"
)
// telemetryStatsCollector collects telemetry usage stats (counts and
// last-observed times per signal). Stats are deployment-scoped since telemetry
// tables carry no org column.
type telemetryStatsCollector struct {
telemetryStore telemetrystore.TelemetryStore
}
func NewTelemetryStatsCollector(telemetryStore telemetrystore.TelemetryStore) StatsCollector {
return &telemetryStatsCollector{telemetryStore: telemetryStore}
}
func (collector *telemetryStatsCollector) Collect(ctx context.Context, _ valuer.UUID) (map[string]any, error) {
stats := make(map[string]any)
if traces, err := collector.countRows(ctx, "SELECT COUNT(*) FROM signoz_traces.distributed_signoz_index_v3"); err == nil {
stats["telemetry.traces.count"] = traces
}
if logs, err := collector.countRows(ctx, "SELECT COUNT(*) FROM signoz_logs.distributed_logs_v2"); err == nil {
stats["telemetry.logs.count"] = logs
}
if metrics, err := collector.countRows(ctx, "SELECT COUNT(*) FROM signoz_metrics.distributed_samples_v4"); err == nil {
stats["telemetry.metrics.count"] = metrics
}
if tracesLastSeenAt, err := lastObservedTraces(ctx, collector.telemetryStore); err == nil && tracesLastSeenAt != nil {
stats["telemetry.traces.last_observed.time"] = tracesLastSeenAt.UTC()
stats["telemetry.traces.last_observed.time_unix"] = tracesLastSeenAt.Unix()
}
if logsLastSeenAt, err := lastObservedLogs(ctx, collector.telemetryStore); err == nil && logsLastSeenAt != nil {
stats["telemetry.logs.last_observed.time"] = logsLastSeenAt.UTC()
stats["telemetry.logs.last_observed.time_unix"] = logsLastSeenAt.Unix()
}
if metricsLastSeenAt, err := lastObservedMetrics(ctx, collector.telemetryStore); err == nil && metricsLastSeenAt != nil {
stats["telemetry.metrics.last_observed.time"] = metricsLastSeenAt.UTC()
stats["telemetry.metrics.last_observed.time_unix"] = metricsLastSeenAt.Unix()
}
return stats, nil
}
func (collector *telemetryStatsCollector) countRows(ctx context.Context, query string) (uint64, error) {
var count uint64
err := collector.telemetryStore.ClickhouseDB().QueryRow(ctx, query).Scan(&count)
return count, err
}

View File

@@ -0,0 +1,138 @@
package statsreporter
import (
"context"
"regexp"
"testing"
"time"
"github.com/DATA-DOG/go-sqlmock"
cmock "github.com/SigNoz/clickhouse-go-mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/SigNoz/signoz/pkg/telemetrystore"
"github.com/SigNoz/signoz/pkg/telemetrystore/telemetrystoretest"
)
// Exact SQL the count queries must generate; see the matching last-observed
// constants in handler_test.go.
const (
tracesCountSQL = "SELECT COUNT(*) FROM signoz_traces.distributed_signoz_index_v3"
logsCountSQL = "SELECT COUNT(*) FROM signoz_logs.distributed_logs_v2"
metricsCountSQL = "SELECT COUNT(*) FROM signoz_metrics.distributed_samples_v4"
)
func TestTelemetryStatsCollectorCollect(t *testing.T) {
collector, chMock := newTelemetryStatsCollectorTest(t)
tracesAt := time.Date(2026, 6, 10, 10, 0, 0, 0, time.UTC)
logsAt := time.Date(2026, 6, 10, 11, 0, 0, 0, time.UTC)
metricsAt := time.Date(2026, 6, 10, 12, 0, 0, 0, time.UTC)
expectTelemetryCount(chMock, tracesCountSQL, 5)
expectTelemetryCount(chMock, logsCountSQL, 7)
expectTelemetryCount(chMock, metricsCountSQL, 9)
expectTracesLastIngested(chMock, tracesAt)
expectLogsLastIngested(chMock, logsAt)
expectMetricsLastIngested(chMock, metricsAt)
stats, err := collector.Collect(context.Background(), testOrgID)
require.NoError(t, err)
assert.Equal(t, uint64(5), stats["telemetry.traces.count"])
assert.Equal(t, uint64(7), stats["telemetry.logs.count"])
assert.Equal(t, uint64(9), stats["telemetry.metrics.count"])
assert.Equal(t, tracesAt, stats["telemetry.traces.last_observed.time"])
assert.Equal(t, tracesAt.Unix(), stats["telemetry.traces.last_observed.time_unix"])
assert.Equal(t, logsAt, stats["telemetry.logs.last_observed.time"])
assert.Equal(t, logsAt.Unix(), stats["telemetry.logs.last_observed.time_unix"])
assert.Equal(t, metricsAt, stats["telemetry.metrics.last_observed.time"])
assert.Equal(t, metricsAt.Unix(), stats["telemetry.metrics.last_observed.time_unix"])
assert.NoError(t, chMock.ExpectationsWereMet())
}
func TestTelemetryStatsCollectorOmitsQuietLastObserved(t *testing.T) {
collector, chMock := newTelemetryStatsCollectorTest(t)
expectTelemetryCount(chMock, tracesCountSQL, 0)
expectTelemetryCount(chMock, logsCountSQL, 0)
expectTelemetryCount(chMock, metricsCountSQL, 0)
expectTracesLastIngested(chMock, time.Time{})
expectLogsLastIngested(chMock, time.Time{})
expectMetricsLastIngested(chMock, time.Time{})
stats, err := collector.Collect(context.Background(), testOrgID)
require.NoError(t, err)
assert.Equal(t, map[string]any{
"telemetry.traces.count": uint64(0),
"telemetry.logs.count": uint64(0),
"telemetry.metrics.count": uint64(0),
}, stats)
assert.NoError(t, chMock.ExpectationsWereMet())
}
func TestTelemetryStatsCollectorCountErrorOmitsOnlyFailedKey(t *testing.T) {
collector, chMock := newTelemetryStatsCollectorTest(t)
tracesAt := time.Date(2026, 6, 10, 10, 0, 0, 0, time.UTC)
chMock.ExpectQueryRow(regexp.QuoteMeta(tracesCountSQL)).
WillReturnRow(cmock.NewRow([]cmock.ColumnType{{Name: "count()", Type: "UInt64"}}, nil)).
WillReturnError(assert.AnError)
expectTelemetryCount(chMock, logsCountSQL, 7)
expectTelemetryCount(chMock, metricsCountSQL, 9)
expectTracesLastIngested(chMock, tracesAt)
expectLogsLastIngested(chMock, time.Time{})
expectMetricsLastIngested(chMock, time.Time{})
stats, err := collector.Collect(context.Background(), testOrgID)
require.NoError(t, err)
assert.NotContains(t, stats, "telemetry.traces.count")
assert.Equal(t, uint64(7), stats["telemetry.logs.count"])
assert.Equal(t, uint64(9), stats["telemetry.metrics.count"])
assert.Equal(t, tracesAt, stats["telemetry.traces.last_observed.time"])
assert.NoError(t, chMock.ExpectationsWereMet())
}
func TestTelemetryStatsCollectorLastObservedErrorOmitsOnlyFailedKeys(t *testing.T) {
collector, chMock := newTelemetryStatsCollectorTest(t)
logsAt := time.Date(2026, 6, 10, 11, 0, 0, 0, time.UTC)
metricsAt := time.Date(2026, 6, 10, 12, 0, 0, 0, time.UTC)
expectTelemetryCount(chMock, tracesCountSQL, 1)
expectTelemetryCount(chMock, logsCountSQL, 1)
expectTelemetryCount(chMock, metricsCountSQL, 1)
chMock.ExpectQueryRow(regexp.QuoteMeta(tracesLastObservedSQL)).
WillReturnRow(cmock.NewRow([]cmock.ColumnType{{Name: "max(timestamp)", Type: "DateTime64(9)"}}, nil)).
WillReturnError(assert.AnError)
expectLogsLastIngested(chMock, logsAt)
expectMetricsLastIngested(chMock, metricsAt)
stats, err := collector.Collect(context.Background(), testOrgID)
require.NoError(t, err)
assert.Equal(t, uint64(1), stats["telemetry.traces.count"])
assert.Equal(t, uint64(1), stats["telemetry.logs.count"])
assert.Equal(t, uint64(1), stats["telemetry.metrics.count"])
assert.NotContains(t, stats, "telemetry.traces.last_observed.time")
assert.NotContains(t, stats, "telemetry.traces.last_observed.time_unix")
assert.Equal(t, logsAt, stats["telemetry.logs.last_observed.time"])
assert.Equal(t, metricsAt, stats["telemetry.metrics.last_observed.time"])
assert.NoError(t, chMock.ExpectationsWereMet())
}
func newTelemetryStatsCollectorTest(t *testing.T) (StatsCollector, cmock.ClickConnMockCommon) {
t.Helper()
ts := telemetrystoretest.New(telemetrystore.Config{}, sqlmock.QueryMatcherRegexp)
ts.Mock().MatchExpectationsInOrder(false)
return NewTelemetryStatsCollector(ts), ts.Mock()
}
func expectTelemetryCount(mock cmock.ClickConnMockCommon, query string, count uint64) {
mock.ExpectQueryRow(regexp.QuoteMeta(query)).
WillReturnRow(cmock.NewRow([]cmock.ColumnType{{Name: "count()", Type: "UInt64"}}, []any{count}))
}

View File

@@ -168,6 +168,9 @@ func NewGettableDashboardFromDashboard(dashboard *Dashboard) (*GettableDashboard
}, nil
}
// StatKeyDashboardCount is the dashboard count stat key shared by the stats reporter and its API consumers.
const StatKeyDashboardCount = "dashboard.count"
func NewStatsFromStorableDashboards(dashboards []*StorableDashboard) map[string]any {
stats := make(map[string]any)
stats["dashboard.panels.count"] = int64(0)
@@ -178,7 +181,7 @@ func NewStatsFromStorableDashboards(dashboards []*StorableDashboard) map[string]
addStatsFromStorableDashboard(dashboard, stats)
}
stats["dashboard.count"] = int64(len(dashboards))
stats[StatKeyDashboardCount] = int64(len(dashboards))
return stats
}

View File

@@ -1,59 +0,0 @@
package dashboardtypes
import (
"github.com/SigNoz/signoz/pkg/errors"
qbtypesv5 "github.com/SigNoz/signoz/pkg/types/querybuildertypes/querybuildertypesv5"
)
var ErrCodeDashboardListFilterInvalid = errors.MustNewCode("dashboard_list_filter_invalid")
// ReservedOps lists the operators each reserved (column-level) DSL key accepts.
// Any non-reserved key is treated as a tag key and uses TagKeyOps.
var ReservedOps = map[DSLKey]map[qbtypesv5.FilterOperator]struct{}{
DSLKeyName: stringSearchOps(),
DSLKeyDescription: stringSearchOps(),
DSLKeyCreatedAt: numericRangeOps(),
DSLKeyUpdatedAt: numericRangeOps(),
DSLKeyCreatedBy: stringSearchOps(),
DSLKeyLocked: opsSet(qbtypesv5.FilterOperatorEqual, qbtypesv5.FilterOperatorNotEqual),
}
// TagKeyOps applies to every non-reserved DSL key — the operator targets the
// tag's value with an implicit case-insensitive match on the tag's key.
var TagKeyOps = opsSet(
qbtypesv5.FilterOperatorEqual, qbtypesv5.FilterOperatorNotEqual,
qbtypesv5.FilterOperatorLike, qbtypesv5.FilterOperatorNotLike,
qbtypesv5.FilterOperatorILike, qbtypesv5.FilterOperatorNotILike,
qbtypesv5.FilterOperatorContains, qbtypesv5.FilterOperatorNotContains,
qbtypesv5.FilterOperatorRegexp, qbtypesv5.FilterOperatorNotRegexp,
qbtypesv5.FilterOperatorIn, qbtypesv5.FilterOperatorNotIn,
qbtypesv5.FilterOperatorExists, qbtypesv5.FilterOperatorNotExists,
)
func stringSearchOps() map[qbtypesv5.FilterOperator]struct{} {
return opsSet(
qbtypesv5.FilterOperatorEqual, qbtypesv5.FilterOperatorNotEqual,
qbtypesv5.FilterOperatorLike, qbtypesv5.FilterOperatorNotLike,
qbtypesv5.FilterOperatorILike, qbtypesv5.FilterOperatorNotILike,
qbtypesv5.FilterOperatorContains, qbtypesv5.FilterOperatorNotContains,
qbtypesv5.FilterOperatorRegexp, qbtypesv5.FilterOperatorNotRegexp,
qbtypesv5.FilterOperatorIn, qbtypesv5.FilterOperatorNotIn,
)
}
func numericRangeOps() map[qbtypesv5.FilterOperator]struct{} {
return opsSet(
qbtypesv5.FilterOperatorEqual, qbtypesv5.FilterOperatorNotEqual,
qbtypesv5.FilterOperatorLessThan, qbtypesv5.FilterOperatorLessThanOrEq,
qbtypesv5.FilterOperatorGreaterThan, qbtypesv5.FilterOperatorGreaterThanOrEq,
qbtypesv5.FilterOperatorBetween, qbtypesv5.FilterOperatorNotBetween,
)
}
func opsSet(ops ...qbtypesv5.FilterOperator) map[qbtypesv5.FilterOperator]struct{} {
m := make(map[qbtypesv5.FilterOperator]struct{}, len(ops))
for _, op := range ops {
m[op] = struct{}{}
}
return m
}

View File

@@ -1,192 +0,0 @@
package dashboardtypes
import (
"slices"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/types"
"github.com/SigNoz/signoz/pkg/types/tagtypes"
"github.com/SigNoz/signoz/pkg/valuer"
"github.com/perses/spec/go/common"
)
const (
DefaultListLimit = 20
MaxListLimit = 200
)
// ListSort is the sort field for the dashboard list endpoint. The value is a
// stable enum so callers can't ask for arbitrary columns.
type ListSort struct{ valuer.String }
var (
ListSortUpdatedAt = ListSort{valuer.NewString("updated_at")}
ListSortCreatedAt = ListSort{valuer.NewString("created_at")}
ListSortName = ListSort{valuer.NewString("name")}
)
func (ListSort) Enum() []any {
return []any{ListSortUpdatedAt, ListSortCreatedAt, ListSortName}
}
func (s ListSort) IsValid() bool {
return slices.ContainsFunc(s.Enum(), func(v any) bool { return v == s })
}
type ListOrder struct{ valuer.String }
var (
ListOrderAsc = ListOrder{valuer.NewString("asc")}
ListOrderDesc = ListOrder{valuer.NewString("desc")}
)
func (ListOrder) Enum() []any {
return []any{ListOrderAsc, ListOrderDesc}
}
func (o ListOrder) IsValid() bool {
return slices.ContainsFunc(o.Enum(), func(v any) bool { return v == o })
}
var ErrCodeDashboardListInvalid = errors.MustNewCode("dashboard_list_invalid")
type ListDashboardsV2Params struct {
Query string `query:"query"`
Sort ListSort `query:"sort"`
Order ListOrder `query:"order"`
Limit int `query:"limit"`
Offset int `query:"offset"`
}
// Validate fills in defaults (sort=updated_at, order=desc, limit=20) and
// rejects out-of-allowlist sort/order values and bad limit/offset. Limit is
// clamped to MaxListLimit on the high side. Sort/order are case-insensitive —
// valuer.String lowercases them at bind time.
func (p *ListDashboardsV2Params) Validate() error {
if p.Sort.IsZero() {
p.Sort = ListSortUpdatedAt
} else if !p.Sort.IsValid() {
return errors.NewInvalidInputf(ErrCodeDashboardListInvalid,
"invalid sort %q — expected one of: `updated_at`, `created_at`, `name`", p.Sort)
}
if p.Order.IsZero() {
p.Order = ListOrderDesc
} else if !p.Order.IsValid() {
return errors.NewInvalidInputf(ErrCodeDashboardListInvalid,
"invalid order %q — expected `asc` or `desc`", p.Order)
}
if p.Limit == 0 {
p.Limit = DefaultListLimit
} else if p.Limit < 0 {
return errors.NewInvalidInputf(ErrCodeDashboardListInvalid,
"invalid limit %d — must be a positive integer", p.Limit)
} else if p.Limit > MaxListLimit {
p.Limit = MaxListLimit
}
if p.Offset < 0 {
return errors.NewInvalidInputf(ErrCodeDashboardListInvalid,
"invalid offset %d — must be a non-negative integer", p.Offset)
}
return nil
}
type listedDashboardV2 struct {
types.Identifiable
types.TimeAuditable
types.UserAuditable
OrgID valuer.UUID `json:"orgId" required:"true"`
Locked bool `json:"locked" required:"true"`
Source Source `json:"source" required:"true"`
SchemaVersion string `json:"schemaVersion" required:"true"`
Name string `json:"name" required:"true"`
Image string `json:"image,omitempty"`
Tags []*tagtypes.GettableTag `json:"tags" required:"true" nullable:"false"`
Spec listedDashboardV2Spec `json:"spec" required:"true"`
}
type listedDashboardV2Spec struct {
Display *common.Display `json:"display,omitempty"`
}
func newListedDashboardV2(v2 *DashboardV2) *listedDashboardV2 {
return &listedDashboardV2{
Identifiable: v2.Identifiable,
TimeAuditable: v2.TimeAuditable,
UserAuditable: v2.UserAuditable,
OrgID: v2.OrgID,
Locked: v2.Locked,
Source: v2.Source,
SchemaVersion: v2.SchemaVersion,
Name: v2.Name,
Image: v2.Image,
Tags: tagtypes.NewGettableTagsFromTags(v2.Tags),
Spec: listedDashboardV2Spec{Display: v2.Spec.Display},
}
}
type ListableDashboardV2 struct {
Dashboards []*listedDashboardV2 `json:"dashboards" required:"true" nullable:"false"`
Total int64 `json:"total" required:"true"`
Tags []*tagtypes.GettableTag `json:"tags" required:"true" nullable:"false"`
}
func NewListableDashboardV2(dashboards []*StorableDashboard, total int64, tagsByEntity map[valuer.UUID][]*tagtypes.Tag, allTags []*tagtypes.Tag) (*ListableDashboardV2, error) {
items := make([]*listedDashboardV2, len(dashboards))
for i, d := range dashboards {
v2, err := d.ToDashboardV2(tagsByEntity[d.ID])
if err != nil {
return nil, err
}
items[i] = newListedDashboardV2(v2)
}
return &ListableDashboardV2{
Dashboards: items,
Total: total,
Tags: tagtypes.NewGettableTagsFromTags(allTags),
}, nil
}
// listedDashboardForUserV2 is a listed dashboard plus the calling user's pin
// state. Only the per-user list endpoint emits this; the pure list omits pins.
type listedDashboardForUserV2 struct {
listedDashboardV2
Pinned bool `json:"pinned" required:"true"`
}
type ListableDashboardForUserV2 struct {
Dashboards []*listedDashboardForUserV2 `json:"dashboards" required:"true" nullable:"false"`
Total int64 `json:"total" required:"true"`
Tags []*tagtypes.GettableTag `json:"tags" required:"true" nullable:"false"`
}
// StorableDashboardWithPinInfo is the per-row shape Store.ListForUser returns: the dashboard
// joined with the calling user's pin state, so the module layer can attach tags
// and assemble the gettable view.
type StorableDashboardWithPinInfo struct {
Dashboard *StorableDashboard
Pinned bool
}
func NewListableDashboardForUserV2(rows []*StorableDashboardWithPinInfo, total int64, tagsByEntity map[valuer.UUID][]*tagtypes.Tag, allTags []*tagtypes.Tag) (*ListableDashboardForUserV2, error) {
items := make([]*listedDashboardForUserV2, len(rows))
for i, r := range rows {
v2, err := r.Dashboard.ToDashboardV2(tagsByEntity[r.Dashboard.ID])
if err != nil {
return nil, err
}
items[i] = &listedDashboardForUserV2{
listedDashboardV2: *newListedDashboardV2(v2),
Pinned: r.Pinned,
}
}
return &ListableDashboardForUserV2{
Dashboards: items,
Total: total,
Tags: tagtypes.NewGettableTagsFromTags(allTags),
}, nil
}

View File

@@ -31,7 +31,7 @@ const (
DSLKeyUpdatedAt DSLKey = "updated_at"
DSLKeyCreatedBy DSLKey = "created_by"
DSLKeyLocked DSLKey = "locked"
DSLKeySource DSLKey = "source"
DSLKeyPublic DSLKey = "public"
)
// reservedDSLKeys are dashboard column-level filter names in the list-query DSL.
@@ -44,7 +44,7 @@ var reservedDSLKeys = map[DSLKey]struct{}{
DSLKeyUpdatedAt: {},
DSLKeyCreatedBy: {},
DSLKeyLocked: {},
DSLKeySource: {},
DSLKeyPublic: {},
}
type DashboardV2 struct {
@@ -110,16 +110,6 @@ func (d *DashboardV2) LockUnlock(lock bool, isAdmin bool, updatedBy string) erro
return nil
}
func (d *DashboardV2) CanDelete() error {
if d.Locked {
return errors.Newf(errors.TypeInvalidInput, errors.CodeInvalidInput, "cannot delete a locked dashboard, please unlock the dashboard to delete")
}
if !d.Source.isUserDeletable() {
return errors.Newf(errors.TypeInvalidInput, ErrCodeDashboardImmutable, "%s dashboards cannot be deleted", d.Source)
}
return nil
}
type DashboardV2MetadataBase struct {
SchemaVersion string `json:"schemaVersion" required:"true"`
Image string `json:"image,omitempty"`

View File

@@ -22,19 +22,10 @@ type PanelPlugin struct {
Spec any `json:"spec"`
}
// PrepareJSONSchema marks the envelope with x-signoz-discriminator;
// signoz.attachDiscriminators promotes it to a real OpenAPI 3 discriminator
// (and strips the duplicate parent properties) after reflection.
// PrepareJSONSchema drops the reflected struct shape (type: object, properties)
// from the envelope so that only the JSONSchemaOneOf result binds.
func (PanelPlugin) PrepareJSONSchema(s *jsonschema.Schema) error {
return markDiscriminator(s, "kind", map[string]string{
string(PanelKindTimeSeries): schemaRef("DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesTimeSeriesPanelSpec"),
string(PanelKindBarChart): schemaRef("DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesBarChartPanelSpec"),
string(PanelKindNumber): schemaRef("DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesNumberPanelSpec"),
string(PanelKindPieChart): schemaRef("DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesPieChartPanelSpec"),
string(PanelKindTable): schemaRef("DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesTablePanelSpec"),
string(PanelKindHistogram): schemaRef("DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesHistogramPanelSpec"),
string(PanelKindList): schemaRef("DashboardtypesPanelPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesListPanelSpec"),
})
return clearOneOfParentShape(s)
}
func (p *PanelPlugin) UnmarshalJSON(data []byte) error {
@@ -86,14 +77,7 @@ type QueryPlugin struct {
}
func (QueryPlugin) PrepareJSONSchema(s *jsonschema.Schema) error {
return markDiscriminator(s, "kind", map[string]string{
string(QueryKindBuilder): schemaRef("DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesDashboardtypesBuilderQuerySpec"),
string(QueryKindComposite): schemaRef("DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5CompositeQuery"),
string(QueryKindFormula): schemaRef("DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5QueryBuilderFormula"),
string(QueryKindPromQL): schemaRef("DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5PromQuery"),
string(QueryKindClickHouseSQL): schemaRef("DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5ClickHouseQuery"),
string(QueryKindTraceOperator): schemaRef("DashboardtypesQueryPluginVariantGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5QueryBuilderTraceOperator"),
})
return clearOneOfParentShape(s)
}
func (p *QueryPlugin) UnmarshalJSON(data []byte) error {
@@ -144,11 +128,7 @@ type VariablePlugin struct {
}
func (VariablePlugin) PrepareJSONSchema(s *jsonschema.Schema) error {
return markDiscriminator(s, "kind", map[string]string{
string(VariableKindDynamic): schemaRef("DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesDynamicVariableSpec"),
string(VariableKindQuery): schemaRef("DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesQueryVariableSpec"),
string(VariableKindCustom): schemaRef("DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesCustomVariableSpec"),
})
return clearOneOfParentShape(s)
}
func (p *VariablePlugin) UnmarshalJSON(data []byte) error {
@@ -196,9 +176,7 @@ type DatasourcePlugin struct {
}
func (DatasourcePlugin) PrepareJSONSchema(s *jsonschema.Schema) error {
return markDiscriminator(s, "kind", map[string]string{
string(DatasourceKindSigNoz): schemaRef("DashboardtypesDatasourcePluginVariantStruct"),
})
return clearOneOfParentShape(s)
}
func (p *DatasourcePlugin) UnmarshalJSON(data []byte) error {
@@ -313,28 +291,10 @@ func decodeSpec(specJSON []byte, target any, kind string) (any, error) {
return target, nil
}
// signozDiscriminatorKey is the extension key that signoz.attachDiscriminators
// promotes into a native OpenAPI 3 discriminator after reflection.
const signozDiscriminatorKey = "x-signoz-discriminator"
// schemaRef builds a local component schema reference for a discriminator mapping.
func schemaRef(name string) string {
return "#/components/schemas/" + name
}
// markDiscriminator tags a oneOf envelope schema with x-signoz-discriminator so
// signoz.attachDiscriminators promotes it to a real OpenAPI 3 discriminator,
// keyed on propertyName, with the given value -> schema-ref mapping. This turns
// the union into a discriminated DTO (instead of an intersection) for generated
// clients.
func markDiscriminator(s *jsonschema.Schema, propertyName string, mapping map[string]string) error {
if s.ExtraProperties == nil {
s.ExtraProperties = map[string]any{}
}
s.ExtraProperties[signozDiscriminatorKey] = map[string]any{
"propertyName": propertyName,
"mapping": mapping,
}
// clearOneOfParentShape drops Type and Properties on a schema that also has a JSONSchemaOneOf.
func clearOneOfParentShape(s *jsonschema.Schema) error {
s.Type = nil
s.Properties = nil
return nil
}

View File

@@ -87,10 +87,7 @@ type Variable struct {
}
func (Variable) PrepareJSONSchema(s *jsonschema.Schema) error {
return markDiscriminator(s, "kind", map[string]string{
string(variable.KindList): schemaRef("DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesListVariableSpec"),
string(variable.KindText): schemaRef("DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpec"),
})
return clearOneOfParentShape(s)
}
func (v *Variable) UnmarshalJSON(data []byte) error {
@@ -170,9 +167,7 @@ var layoutSpecs = map[dashboard.LayoutKind]func() any{
}
func (Layout) PrepareJSONSchema(s *jsonschema.Schema) error {
return markDiscriminator(s, "kind", map[string]string{
string(dashboard.KindGridLayout): schemaRef("DashboardtypesLayoutEnvelopeGithubComPersesSpecGoDashboardGridLayoutSpec"),
})
return clearOneOfParentShape(s)
}
func (l *Layout) UnmarshalJSON(data []byte) error {

View File

@@ -93,21 +93,14 @@ func (b BuilderQuerySpec) MarshalJSON() ([]byte, error) {
return json.Marshal(b.Spec)
}
// PrepareJSONSchema marks the envelope with x-signoz-discriminator keyed on
// `signal`. Each QueryBuilderQuery[T] variant pins `signal` to its one value
// (via its own PrepareJSONSchema in the qb package), so the union resolves
// cleanly even though it doesn't carry a `kind`.
// PrepareJSONSchema drops the reflected struct shape so only the
// JSONSchemaOneOf result binds.
func (BuilderQuerySpec) PrepareJSONSchema(s *jsonschema.Schema) error {
return markDiscriminator(s, "signal", map[string]string{
telemetrytypes.SignalLogs.StringValue(): schemaRef("Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5LogAggregation"),
telemetrytypes.SignalMetrics.StringValue(): schemaRef("Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5MetricAggregation"),
telemetrytypes.SignalTraces.StringValue(): schemaRef("Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5TraceAggregation"),
})
return clearOneOfParentShape(s)
}
// JSONSchemaOneOf exposes the three signal-dispatched shapes a builder query
// can take. Mirrors qb.UnmarshalBuilderQueryBySignal's runtime dispatch. Each
// QueryBuilderQuery[T] pins its own `signal` enum (see its PrepareJSONSchema).
// can take. Mirrors qb.UnmarshalBuilderQueryBySignal's runtime dispatch.
func (BuilderQuerySpec) JSONSchemaOneOf() []any {
return []any{
qb.QueryBuilderQuery[qb.LogAggregation]{},

View File

@@ -51,10 +51,6 @@ func (s *Source) UnmarshalJSON(data []byte) error {
return s.s.UnmarshalJSON(data)
}
func (s Source) isUserDeletable() bool {
return s == SourceUser
}
func NewSource(source string) (Source, error) {
candidate := Source{s: valuer.NewString(source)}
if !candidate.IsValid() {

View File

@@ -32,23 +32,4 @@ type Store interface {
DeletePublic(context.Context, string) error
RunInTx(context.Context, func(context.Context) error) error
// ════════════════════════════════════════════════════════════════════════
// v2 dashboard methods
// ════════════════════════════════════════════════════════════════════════
// int64 return is the total row count for the filter (pre-limit/offset).
// ListV2 is the pure list; ListForUser additionally joins the caller's pins.
ListV2(ctx context.Context, orgID valuer.UUID, params *ListDashboardsV2Params) ([]*StorableDashboard, int64, error)
ListForUser(ctx context.Context, orgID valuer.UUID, userID valuer.UUID, params *ListDashboardsV2Params) ([]*StorableDashboardWithPinInfo, int64, error)
// Returns ErrCodePinnedDashboardLimitHit when the user is at MaxPinnedDashboardsPerUser.
PinForUser(ctx context.Context, preference *UserDashboardPreference) error
UnpinForUser(ctx context.Context, userID valuer.UUID, dashboardID valuer.UUID) error
DeletePreferencesForDashboard(ctx context.Context, dashboardID valuer.UUID) error
DeletePreferencesForUser(ctx context.Context, userID valuer.UUID) error
}

View File

@@ -1,28 +0,0 @@
package dashboardtypes
import (
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/valuer"
"github.com/uptrace/bun"
)
const MaxPinnedDashboardsPerUser = 10
var ErrCodePinnedDashboardLimitHit = errors.MustNewCode("pinned_dashboard_limit_hit")
// Only the pin is tracked for now; more preferences can be added later.
type UserDashboardPreference struct {
bun.BaseModel `bun:"table:user_dashboard_preference,alias:user_dashboard_preference"`
UserID valuer.UUID `bun:"user_id,pk,type:text"`
DashboardID valuer.UUID `bun:"dashboard_id,pk,type:text"`
IsPinned bool `bun:"is_pinned,notnull,default:false"`
}
func NewUserDashboardPreference(userID, dashboardID valuer.UUID) *UserDashboardPreference {
return &UserDashboardPreference{
UserID: userID,
DashboardID: dashboardID,
IsPinned: true,
}
}

View File

@@ -0,0 +1,27 @@
package emptystatetypes
import "time"
type LicenseStatus string
const LicenseStatusUnknown LicenseStatus = "UNKNOWN"
func (status LicenseStatus) StringValue() string {
return string(status)
}
type OrgContext struct {
HasIngestedData bool `json:"hasIngestedData" required:"true"`
LastIngestedAt LastIngestedAt `json:"lastIngestedAt" required:"true"`
AlertsCount int `json:"alertsCount" required:"true"`
DashboardsCount int `json:"dashboardsCount" required:"true"`
SavedViewsCount int `json:"savedViewsCount" required:"true"`
LicenseStatus LicenseStatus `json:"licenseStatus" required:"true" description:"Raw Zeus license state. Known values include DEFAULTED, ACTIVATED, EXPIRED, ISSUED, EVALUATING, EVALUATION_EXPIRED, TERMINATED, CANCELLED. UNKNOWN is emitted when no license state is available."`
}
// LastIngestedAt carries per-signal latest ingest times; null means no data has been observed.
type LastIngestedAt struct {
Logs *time.Time `json:"logs" required:"true" description:"Null when no logs have been ingested."`
Traces *time.Time `json:"traces" required:"true" description:"Null when no traces have been ingested."`
Metrics *time.Time `json:"metrics" required:"true" description:"Null when no metrics have been ingested."`
}

View File

@@ -0,0 +1,40 @@
package emptystatetypes
import (
"encoding/json"
"testing"
"github.com/stretchr/testify/assert"
)
func TestLicenseStatusMarshalJSON(t *testing.T) {
tests := []struct {
name string
status LicenseStatus
want string
}{
{
name: "known zeus state preserves case",
status: LicenseStatus("ACTIVATED"),
want: `"ACTIVATED"`,
},
{
name: "unknown sentinel preserves case",
status: LicenseStatusUnknown,
want: `"UNKNOWN"`,
},
{
name: "novel state passes through",
status: LicenseStatus("FUTURE_STATE"),
want: `"FUTURE_STATE"`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := json.Marshal(tt.status)
assert.NoError(t, err)
assert.Equal(t, tt.want, string(got))
})
}
}

View File

@@ -358,11 +358,14 @@ func NewLicenseFromStorableLicense(storableLicense *StorableLicense) (*License,
}
// StatKeyLicenseStateName is the license state stat key shared by the stats reporter and its API consumers.
const StatKeyLicenseStateName = "license.state.name"
func NewStatsFromLicense(license *License) map[string]any {
return map[string]any{
"license.id": license.ID.StringValue(),
"license.plan.name": license.PlanName.StringValue(),
"license.state.name": license.State,
StatKeyLicenseStateName: license.State,
"license.free_until.time": license.FreeUntil.UTC(),
}
}

View File

@@ -137,7 +137,7 @@ func (t *Type) Scan(src interface{}) error {
}
func (t Type) IsPercentileSpaceAggregationAllowed() bool {
return t == HistogramType || t == ExpHistogramType
return t == HistogramType || t == ExpHistogramType || t == SummaryType
}
var (

View File

@@ -2,11 +2,9 @@ package querybuildertypesv5
import (
"fmt"
"slices"
"github.com/SigNoz/signoz/pkg/types/metrictypes"
"github.com/SigNoz/signoz/pkg/types/telemetrytypes"
"github.com/swaggest/jsonschema-go"
)
type QueryBuilderQuery[T any] struct {
@@ -71,32 +69,6 @@ type QueryBuilderQuery[T any] struct {
ShiftBy int64 `json:"-"`
}
// PrepareJSONSchema pins `signal` to the single value implied by the aggregation
// type T, as an inline single-value enum, and marks it required. This lets a
// oneOf over the QueryBuilderQuery[T] instantiations be discriminated by signal.
func (QueryBuilderQuery[T]) PrepareJSONSchema(s *jsonschema.Schema) error {
var signal telemetrytypes.Signal
switch any(*new(T)).(type) {
case LogAggregation:
signal = telemetrytypes.SignalLogs
case MetricAggregation:
signal = telemetrytypes.SignalMetrics
case TraceAggregation:
signal = telemetrytypes.SignalTraces
default:
return nil
}
if _, ok := s.Properties["signal"]; !ok {
return nil
}
prop := (&jsonschema.Schema{}).WithType(jsonschema.String.Type()).WithEnum(signal.StringValue())
s.Properties["signal"] = prop.ToSchemaOrBool()
if !slices.Contains(s.Required, "signal") {
s.Required = append(s.Required, "signal")
}
return nil
}
// Copy creates a deep copy of the QueryBuilderQuery.
func (q QueryBuilderQuery[T]) Copy() QueryBuilderQuery[T] {
// start with a shallow copy

View File

@@ -317,19 +317,6 @@ func (q *QueryBuilderQuery[T]) validateAggregations(cfg validationConfig) error
return nil
}
func (m MetricAggregation) ValidateForType() error {
if m.SpaceAggregation.IsPercentile() && !m.Type.IsPercentileSpaceAggregationAllowed() {
return errors.Newf(
errors.TypeInvalidInput,
errors.CodeInvalidInput,
"invalid space aggregation `%s` for metric type `%s`, percentile space aggregations are only supported for `histogram`, `exponentialhistogram` metric types",
m.SpaceAggregation.StringValue(),
m.Type.StringValue(),
)
}
return nil
}
func (q *QueryBuilderQuery[T]) validateLimitAndPagination(cfg validationConfig) error {
if cfg.skipLimitOffsetValidation {
return nil

View File

@@ -1421,62 +1421,3 @@ func TestNonAggregationFieldsSkipped(t *testing.T) {
}
})
}
func TestMetricAggregationValidateForType(t *testing.T) {
cases := []struct {
name string
metricType metrictypes.Type
spaceAggregation metrictypes.SpaceAggregation
comparisonParam *metrictypes.ComparisonSpaceAggregationParam
wantErr bool
}{
{
name: "percentile on histogram is allowed",
metricType: metrictypes.HistogramType,
spaceAggregation: metrictypes.SpaceAggregationPercentile95,
wantErr: false,
},
{
name: "percentile on exponential histogram is allowed",
metricType: metrictypes.ExpHistogramType,
spaceAggregation: metrictypes.SpaceAggregationPercentile99,
wantErr: false,
},
{
name: "percentile on summary is not allowed",
metricType: metrictypes.SummaryType,
spaceAggregation: metrictypes.SpaceAggregationPercentile95,
wantErr: true,
},
{
name: "percentile on sum is not allowed",
metricType: metrictypes.SumType,
spaceAggregation: metrictypes.SpaceAggregationPercentile95,
wantErr: true,
},
{
name: "non-percentile space aggregation on sum is allowed",
metricType: metrictypes.SumType,
spaceAggregation: metrictypes.SpaceAggregationSum,
wantErr: false,
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
agg := MetricAggregation{
MetricName: "test_metric",
Type: tc.metricType,
SpaceAggregation: tc.spaceAggregation,
ComparisonSpaceAggregationParam: tc.comparisonParam,
}
err := agg.ValidateForType()
if tc.wantErr && err == nil {
t.Errorf("expected error, got nil")
}
if !tc.wantErr && err != nil {
t.Errorf("expected no error, got: %v", err)
}
})
}
}

View File

@@ -20,6 +20,9 @@ type StorableRule struct {
OrgID string `bun:"org_id,type:text"`
}
// StatKeyRuleCount is the rule count stat key shared by the stats reporter and its API consumers.
const StatKeyRuleCount = "rule.count"
func NewStatsFromRules(rules []*StorableRule) map[string]any {
stats := make(map[string]any)
for _, rule := range rules {
@@ -43,7 +46,7 @@ func NewStatsFromRules(rules []*StorableRule) map[string]any {
}
}
stats["rule.count"] = int64(len(rules))
stats[StatKeyRuleCount] = int64(len(rules))
return stats
}

View File

@@ -22,6 +22,9 @@ type SavedView struct {
ExtraData string `json:"extraData" bun:"extra_data,type:text"`
}
// StatKeySavedViewCount is the saved view count stat key shared by the stats reporter and its API consumers.
const StatKeySavedViewCount = "savedview.count"
func NewStatsFromSavedViews(savedViews []*SavedView) map[string]any {
stats := make(map[string]any)
for _, savedView := range savedViews {
@@ -33,6 +36,6 @@ func NewStatsFromSavedViews(savedViews []*SavedView) map[string]any {
}
}
stats["savedview.count"] = int64(len(savedViews))
stats[StatKeySavedViewCount] = int64(len(savedViews))
return stats
}

View File

@@ -43,7 +43,7 @@ type PostableTag struct {
Value string `json:"value" required:"true"`
}
type GettableTag PostableTag
type GettableTag = PostableTag
func NewGettableTagFromTag(tag *Tag) *GettableTag {
return &GettableTag{Key: tag.Key, Value: tag.Value}

View File

@@ -1,48 +0,0 @@
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"da-p1-uid","k8s.pod.name":"da-p1","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"da-p2-uid","k8s.pod.name":"da-p2","k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":3,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":3,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"da-dep","k8s.namespace.name":"ns-da","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":3,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}

View File

@@ -1,384 +0,0 @@
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p1-uid", "k8s.pod.name": "web-a-prod-acc-1-p1", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-prod-acc-1-p2-uid", "k8s.pod.name": "web-a-prod-acc-1-p2", "k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p1-uid", "k8s.pod.name": "web-a-dev-acc-1-p1", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-a-dev-acc-1-p2-uid", "k8s.pod.name": "web-a-dev-acc-1-p2", "k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p1-uid", "k8s.pod.name": "api-a-prod-acc-1-p1", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-prod-acc-1-p2-uid", "k8s.pod.name": "api-a-prod-acc-1-p2", "k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-a-prod", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p1-uid", "k8s.pod.name": "api-a-dev-acc-1-p1", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-a-dev-acc-1-p2-uid", "k8s.pod.name": "api-a-dev-acc-1-p2", "k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-a-dev", "k8s.namespace.name": "ns-a", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p1-uid", "k8s.pod.name": "web-b-prod-acc-1-p1", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-prod-acc-1-p2-uid", "k8s.pod.name": "web-b-prod-acc-1-p2", "k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p1-uid", "k8s.pod.name": "web-b-dev-acc-1-p1", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "web-b-dev-acc-1-p2-uid", "k8s.pod.name": "web-b-dev-acc-1-p2", "k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "web-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p1-uid", "k8s.pod.name": "api-b-prod-acc-1-p1", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-prod-acc-1-p2-uid", "k8s.pod.name": "api-b-prod-acc-1-p2", "k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-b-prod", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "prod"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 100000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.4, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p1-uid", "k8s.pod.name": "api-b-dev-acc-1-p1", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu.usage", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.cpu_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory.working_set", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 200000000.0, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_request_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.6, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.memory_limit_utilization", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 0.5, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.pod.phase", "labels": {"k8s.pod.uid": "api-b-dev-acc-1-p2-uid", "k8s.pod.name": "api-b-dev-acc-1-p2", "k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:00:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:02:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.desired", "labels": {"k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 3, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}
{"metric_name": "k8s.deployment.available", "labels": {"k8s.deployment.name": "api-b-dev", "k8s.namespace.name": "ns-b", "k8s.cluster.name": "cluster-x", "env": "dev"}, "timestamp": "2025-01-10T10:04:00+00:00", "value": 2, "temporality": "Unspecified", "type_": "Gauge", "is_monotonic": false}

View File

@@ -1,108 +0,0 @@
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-a1-p1-uid","k8s.pod.name":"gb-dep-a1-p1","k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-a1","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-a2-p1-uid","k8s.pod.name":"gb-dep-a2-p1","k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-a2","k8s.namespace.name":"gb-ns-a","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-b1-p1-uid","k8s.pod.name":"gb-dep-b1-p1","k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-b1","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu.usage","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.cpu_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory.working_set","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":100000000.0,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_request_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.5,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.memory_limit_utilization","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":0.4,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.pod.phase","labels":{"k8s.pod.uid":"gb-dep-b2-p1-uid","k8s.pod.name":"gb-dep-b2-p1","k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":2,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:00:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:02:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.desired","labels":{"k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}
{"metric_name":"k8s.deployment.available","labels":{"k8s.deployment.name":"gb-dep-b2","k8s.namespace.name":"gb-ns-b","k8s.cluster.name":"cluster-x"},"timestamp":"2025-01-10T10:04:00+00:00","value":1,"temporality":"Unspecified","type_":"Gauge","is_monotonic":false}

Some files were not shown because too many files have changed in this diff Show More