Skip to content

feat(telemetryrouter): onboard TelemetryRouter service - #1601

Open
Fyusel wants to merge 1 commit into
mainfrom
onboard-telemetryrouter
Open

Fyusel wants to merge 1 commit into
mainfrom
onboard-telemetryrouter

Conversation

@Fyusel

@Fyusel Fyusel commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

STACKITCLI-382

Description

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@Fyusel
Fyusel requested a review from a team as a code owner September 14, 2026 07:35
@Fyusel
Fyusel force-pushed the onboard-telemetryrouter branch from 4d194f4 to 8af9e54 Compare September 14, 2026 08:39
@github-actions

Copy link
Copy Markdown

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions Bot added the Stale label Sep 22, 2026
@marceljk marceljk removed the Stale label Sep 25, 2026
Comment thread go.mod Outdated
Comment thread internal/pkg/services/telemetryrouter/utils/utils.go Outdated
Comment thread internal/pkg/services/telemetryrouter/utils/utils.go Outdated
Comment thread internal/cmd/beta/telemetryrouter/access_token/delete/delete.go Outdated
Comment thread internal/cmd/beta/telemetryrouter/access_token/describe/describe.go Outdated
Comment thread internal/cmd/beta/telemetryrouter/instance/create/create.go Outdated
Comment thread internal/cmd/beta/telemetryrouter/instance/describe/describe.go Outdated
Comment thread internal/cmd/beta/telemetryrouter/instance/describe/describe.go Outdated
Comment thread internal/cmd/beta/telemetryrouter/instance/generate-filter/generate_filter.go Outdated
Comment on lines +44 to +60
Short: "Updates a TelemetryRouter instance",
Long: "Updates a TelemetryRouter instance.",
Args: args.SingleArg(argInstanceID, utils.ValidateUUID),
Example: examples.Build(
examples.NewExample(
`Update the display name of the TelemetryRouter instance with ID "xxx"`,
"$ stackit beta telemetryrouter instance update xxx --display-name new-name"),
examples.NewExample(
`Update the description of the TelemetryRouter instance with ID "xxx"`,
"$ stackit beta telemetryrouter instance update xxx --description new-description"),
examples.NewExample(
`Replace the filter attributes of the TelemetryRouter instance with ID "xxx" so it only routes telemetry data for HTTP GET or HEAD requests, matched at the resource level`,
`$ stackit beta telemetryrouter instance update xxx --filter-attribute "key=http.method;level=resource;matcher==;values=GET,HEAD"`),
examples.NewExample(
`Replace the filter attributes of the TelemetryRouter instance with ID "xxx" with many filter attributes sourced from a JSON file (recommended over repeating --filter-attribute for more than a handful of attributes); `+
`use "stackit beta telemetryrouter instance generate-filter --instance-id xxx" to generate a starting point from the instance's current filter`,
`$ stackit beta telemetryrouter instance update xxx --filter @./filter.json`),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't tested it yet, but the endpoint behind this command is a PUT endpoint. If it's also implement to behave like a PUT, it means that everything that isn't set by the user during the update, will be removed. This relates not only to the filter / filter-attribute but also display name and description.
I think this should be mentioned here, to make aware of the different behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or it could be even discussed, if we want to have here the update command. Because this behave different like our existing update commands

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested it today and the PUT endpoint behaves partial as patch and put. The name remains unchanged if it's not set during the update. But the description and filter are removed if they are not part of the update

Comment thread internal/cmd/beta/telemetryrouter/destination/update/update.go Outdated

func NewCmd(params *types.CmdParams) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("update %s", destinationIdArg),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This update command has also a mixed behavior. If description is unset during the update it will be removed, but the name and config remain unchanged if they are not set within the update.

I assume the behavior of the API is in general, that for fields that are not required during creation, it behaves like a PUT, but for fields that are required during creation, it behaves like a PATCH during the update.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same applies for the access-token update command

Comment thread docs/stackit_beta.md
@Fyusel
Fyusel force-pushed the onboard-telemetryrouter branch 5 times, most recently from 06b8a20 to 786f253 Compare October 19, 2026 12:02
STACKITCLI-382

Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
@Fyusel
Fyusel force-pushed the onboard-telemetryrouter branch from 786f253 to 3cc7194 Compare October 19, 2026 12:39
@github-actions

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 20 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/create 44.07% (+44.07%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/delete 31.11% (+31.11%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/describe 71.11% (+71.11%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/list 71.88% (+71.88%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/update 40.62% (+40.62%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/create 49.23% (+49.23%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/delete 31.11% (+31.11%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/describe 72.34% (+72.34%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/generate-payload 55.38% (+55.38%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/list 71.88% (+71.88%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/update 36.67% (+36.67%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/create 51.56% (+51.56%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/delete 23.40% (+23.40%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/describe 72.92% (+72.92%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/generate-filter 46.51% (+46.51%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/list 68.25% (+68.25%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/update 56.67% (+56.67%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/config/set 91.61% (+0.17%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/config/unset 34.97% (-0.03%) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/config 70.73% (+0.10%) 👍
github.com/stackitcloud/stackit-cli/internal/pkg/services/telemetryrouter/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/telemetryrouter/utils 30.77% (+30.77%) 🌟
Coverage details

Compared to commit 538e0ac (run #39250588989)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/beta.go 0.00% (ø) 11 (+1) 0 11 (+1)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/access_token.go 0.00% (ø) 8 (+8) 0 8 (+8)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/create/create.go 44.07% (+44.07%) 59 (+59) 26 (+26) 33 (+33) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/delete/delete.go 31.11% (+31.11%) 45 (+45) 14 (+14) 31 (+31) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/describe/describe.go 71.11% (+71.11%) 45 (+45) 32 (+32) 13 (+13) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/list/list.go 71.88% (+71.88%) 64 (+64) 46 (+46) 18 (+18) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/update/update.go 40.62% (+40.62%) 64 (+64) 26 (+26) 38 (+38) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/create/create.go 49.23% (+49.23%) 65 (+65) 32 (+32) 33 (+33) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/delete/delete.go 31.11% (+31.11%) 45 (+45) 14 (+14) 31 (+31) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/describe/describe.go 72.34% (+72.34%) 47 (+47) 34 (+34) 13 (+13) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/destination.go 0.00% (ø) 9 (+9) 0 9 (+9)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/generate-payload/generate_payload.go 55.38% (+55.38%) 65 (+65) 36 (+36) 29 (+29) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/list/list.go 71.88% (+71.88%) 64 (+64) 46 (+46) 18 (+18) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/update/update.go 36.67% (+36.67%) 60 (+60) 22 (+22) 38 (+38) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/create/create.go 51.56% (+51.56%) 64 (+64) 33 (+33) 31 (+31) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/delete/delete.go 23.40% (+23.40%) 47 (+47) 11 (+11) 36 (+36) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/describe/describe.go 72.92% (+72.92%) 48 (+48) 35 (+35) 13 (+13) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/generate-filter/generate_filter.go 46.51% (+46.51%) 43 (+43) 20 (+20) 23 (+23) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/instance.go 0.00% (ø) 9 (+9) 0 9 (+9)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/list/list.go 68.25% (+68.25%) 63 (+63) 43 (+43) 20 (+20) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/update/update.go 56.67% (+56.67%) 60 (+60) 34 (+34) 26 (+26) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/telemetryrouter.go 0.00% (ø) 6 (+6) 0 6 (+6)
github.com/stackitcloud/stackit-cli/internal/cmd/config/set/set.go 91.61% (+0.17%) 155 (+3) 142 (+3) 13 👍
github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset.go 34.97% (-0.03%) 143 (+3) 50 (+1) 93 (+2) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/config/config.go 91.55% (+0.12%) 71 (+1) 65 (+1) 6 👍
github.com/stackitcloud/stackit-cli/internal/pkg/services/telemetryrouter/client/client.go 0.00% (ø) 1 (+1) 0 1 (+1)
github.com/stackitcloud/stackit-cli/internal/pkg/services/telemetryrouter/utils/utils.go 30.77% (+30.77%) 26 (+26) 8 (+8) 18 (+18) 🌟

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files:

  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/delete/delete_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/access_token/update/update_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/delete/delete_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/generate-payload/generate_payload_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/update/update_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/delete/delete_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/generate-filter/generate_filter_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/instance/update/update_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset_test.go
  • github.com/stackitcloud/stackit-cli/internal/pkg/services/telemetryrouter/utils/utils_test.go

type inputModel struct {
*globalflags.GlobalFlagModel
InstanceId string
Payload *telemetryrouter.CreateDestinationPayload

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would suggest to not set the payload as pointer, because it's required and it safe potentially nil pointer

Suggested change
Payload *telemetryrouter.CreateDestinationPayload
Payload telemetryrouter.CreateDestinationPayload

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.

4 participants