Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(operator): extend LokiStack authorization to support OTel Semantics #16031

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

JoaoBraveCoding
Copy link
Collaborator

@JoaoBraveCoding JoaoBraveCoding commented Jan 31, 2025

What this PR does / why we need it:

This PR extends the authorization to support OTel Semantics making authorization work with k8s_namespace_name for both queries & rules.

Depends on observatorium/opa-openshift#32

Which issue(s) this PR fixes:

See https://issues.redhat.com/browse/LOG-6577

Special notes for your reviewer:

Rules were tested with the following manifest

apiVersion: loki.grafana.com/v1
kind: AlertingRule
metadata:
  name: alerting-rule
  namespace: log-test-0
  labels:
    openshift.io/cluster-monitoring: "true"
spec:
  tenantID: "application"
  groups:
    - name: alerting-rule
      rules:
        - alert: HighPercentageErrorOld
          expr: |
            sum(rate({ log_type="application", kubernetes_namespace_name="log-test-0" } | level="error"[7m])) by (job)
              > 0.01
          for: 10s
          labels:
            severity: info
          annotations:
            summary: High Logger Test Errors Old
            description:  High Logger Test Errors Old
        - alert: HighPercentageErrorNew
          expr: |
            sum(rate({ log_type="application", k8s_namespace_name="log-test-0" } | level="error"[7m])) by (job)
              > 0.01
          for: 10s
          labels:
            severity: info
          annotations:
            summary: High Logger Test Errors New
            description:  High Logger Test Errors New
        - alert: HighPercentageErrorNewBad
          expr: |
            sum(rate({ log_type="application", k8s_namespace_name="log-test-1" } | level="error"[7m])) by (job)
              > 0.01
          for: 10s
          labels:
            severity: info
          annotations:
            summary: High Logger Test Errors New Bad
            description:  High Logger Test Errors New Bad
        - alert: HighPercentageErrorMix
          expr: |
            sum(rate({ log_type="application", kubernetes_namespace_name="log-test-0", k8s_namespace_name="log-test-0" } | level="error"[7m])) by (job)
              > 0.01
          for: 10s
          labels:
            severity: info
          annotations:
            summary: High Logger Test Errors Mix
            description:  High Logger Test Errors Mix

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@JoaoBraveCoding JoaoBraveCoding marked this pull request as ready for review January 31, 2025 15:02
@JoaoBraveCoding
Copy link
Collaborator Author

Moving to WIP as querying obs-api to get rules currently doesn't work as intended

@JoaoBraveCoding JoaoBraveCoding changed the title feat(operator): extend LokiStack authorization to support OTel Semantics WIP: feat(operator): extend LokiStack authorization to support OTel Semantics Jan 31, 2025
@JoaoBraveCoding JoaoBraveCoding changed the title WIP: feat(operator): extend LokiStack authorization to support OTel Semantics feat(operator): extend LokiStack authorization to support OTel Semantics Jan 31, 2025
@JoaoBraveCoding JoaoBraveCoding changed the title feat(operator): extend LokiStack authorization to support OTel Semantics WIP: feat(operator): extend LokiStack authorization to support OTel Semantics Jan 31, 2025
@JoaoBraveCoding JoaoBraveCoding changed the title WIP: feat(operator): extend LokiStack authorization to support OTel Semantics feat(operator): extend LokiStack authorization to support OTel Semantics Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant