Skip to content

Commit

Permalink
Merge pull request #14 from perses/nexucis/update
Browse files Browse the repository at this point in the history
Nexucis/update
  • Loading branch information
Nexucis authored Nov 5, 2024
2 parents 6fdf807 + 04e28dc commit 1ca125a
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Bug report
description: Create a report to help us improve.
labels: [ "bug" ]
body:
- type: markdown
attributes:
value: |
Thank you for opening a bug report for MetricUsage.
Please do *NOT* ask support questions in Github issues.
If your issue is not a feature request or bug report contact us directly on slack.
- type: textarea
attributes:
label: What did you do?
description: Please provide steps for us to reproduce this issue.
validations:
required: true
- type: textarea
attributes:
label: What did you expect to see?
- type: textarea
attributes:
label: What did you see instead? Under which circumstances?
validations:
required: true
- type: markdown
attributes:
value: |
## Environment
- type: input
attributes:
label: System information
description: insert output of `uname -srm` here, or operating system version
placeholder: e.g. Linux 5.16.15 x86_64
- type: input
attributes:
label: MetricsUsage version
description: Insert the MetricsUsage version here.
placeholder: e.g. 0.3.0
- type: textarea
attributes:
label: MetricsUsage configuration file
description: Insert relevant configuration here. Don't forget to remove secrets.
render: yaml
- type: textarea
attributes:
label: Logs
description: Insert MetricsUsage logs relevant to the issue here.
render: text
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/prometheus/common v0.60.1
github.com/prometheus/prometheus v0.55.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
golang.org/x/oauth2 v0.23.0
)

Expand All @@ -34,6 +35,7 @@ require (
github.com/charmbracelet/x/ansi v0.2.3 // indirect
github.com/cloudflare/circl v1.3.8 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dennwc/varint v1.0.0 // indirect
github.com/elliotchance/orderedmap/v2 v2.2.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
Expand Down Expand Up @@ -91,6 +93,7 @@ require (
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
Expand Down
13 changes: 13 additions & 0 deletions utils/prometheus/prometheus_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package prometheus

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestExtractMetricNamesFromPromQL(t *testing.T) {
result, err := ExtractMetricNamesFromPromQL("service_status{env=~\"$env\",region=~\"$region\"}")
assert.NoError(t, err)
assert.Equal(t, []string{"service_status"}, result)
}

0 comments on commit 1ca125a

Please sign in to comment.