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 Resolved
Comment thread docs/stackit_beta.md Resolved
@Fyusel
Fyusel force-pushed the onboard-telemetryrouter branch 6 times, most recently from 786f253 to 3cc7194 Compare October 19, 2026 12:39
@Fyusel
Fyusel force-pushed the onboard-telemetryrouter branch 2 times, most recently from 7a67d0f to d4626e2 Compare October 20, 2026 08:09
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

This PR was marked as stale after 14 days of inactivity and will be closed after another 14 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 Nov 4, 2026
@GokceGK GokceGK removed the Stale label Nov 4, 2026
@github-actions

Copy link
Copy Markdown

This PR was marked as stale after 14 days of inactivity and will be closed after another 14 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 Nov 19, 2026
@Fyusel
Fyusel force-pushed the onboard-telemetryrouter branch from d4626e2 to e6c7500 Compare November 26, 2026 07:56
@Fyusel Fyusel removed the Stale label Nov 26, 2026
@Fyusel
Fyusel force-pushed the onboard-telemetryrouter branch 3 times, most recently from d7e8dd2 to cc021d1 Compare November 26, 2026 09:17
STACKITCLI-382

Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
@Fyusel
Fyusel force-pushed the onboard-telemetryrouter branch from cc021d1 to 9260ade Compare November 26, 2026 09:50
@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 51.43% (+51.43%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/create 48.44% (+48.44%) 🌟
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 48.48% (+48.48%) 🌟
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 52.94% (+52.94%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/config/set 91.77% (+0.16%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/config/unset 34.93% (-0.03%) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/config 69.86% (+0.10%) 👍
github.com/stackitcloud/stackit-cli/internal/pkg/services/telemetryrouter/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/telemetryrouter/utils 40.00% (+40.00%) 🌟
Coverage details

Compared to commit f0f2a01 (run #45576622666)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/beta.go 0.00% (ø) 12 (+1) 0 12 (+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 51.43% (+51.43%) 70 (+70) 36 (+36) 34 (+34) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/telemetryrouter/destination/create/create.go 48.44% (+48.44%) 64 (+64) 31 (+31) 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 48.48% (+48.48%) 66 (+66) 32 (+32) 34 (+34) 🌟
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 52.94% (+52.94%) 68 (+68) 36 (+36) 32 (+32) 🌟
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.77% (+0.16%) 158 (+3) 145 (+3) 13 👍
github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset.go 34.93% (-0.03%) 146 (+3) 51 (+1) 95 (+2) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/config/config.go 86.84% (+0.18%) 76 (+1) 66 (+1) 10 👍
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 40.00% (+40.00%) 30 (+30) 12 (+12) 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

Payload: payload,
}

// The input model is deliberately not logged, as the payload may contain credentials

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.

So far we always logged the model even if it contains any secrets. If you search through the code base "secretflag" you find some examples.

I think we should handle this consistent and I also think that it would be nice to log all other not sensitive values.
For me it's fine to just create a follow up ticket for this and leave it for this PR like it is

return req
}

func outputResult(p *print.Printer, model *inputModel, instanceLabel string, resp *telemetryrouter.DestinationResponse) error {

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 replace here the parameter model *inputModel with outputFormat string. This keeps the function simpler because you can remove then some nil checks

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 other commands

Comment on lines +114 to +120
table.AddRow("CREATION TIME", instance.CreationTime.Format(time.DateTime))
content = append(content, table)

if instance.Filter != nil && len(instance.Filter.Attributes) > 0 {
filterTable := tables.NewTable()
filterTable.SetTitle("FILTER ATTRIBUTES")
filterTable.SetHeader("KEY", "LEVEL", "MATCHER", "VALUES")

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.

Currently the output doesn't contain the information if the filter is disabled or not. I would probably add this to the the first table, because it applies to all defined filters. Something like this:

Suggested change
table.AddRow("CREATION TIME", instance.CreationTime.Format(time.DateTime))
content = append(content, table)
if instance.Filter != nil && len(instance.Filter.Attributes) > 0 {
filterTable := tables.NewTable()
filterTable.SetTitle("FILTER ATTRIBUTES")
filterTable.SetHeader("KEY", "LEVEL", "MATCHER", "VALUES")
table.AddRow("CREATION TIME", instance.CreationTime.Format(time.DateTime))
if instance.Filter != nil {
table.AddSeparator()
table.AddRow("FILTER DISABLED", utils.PtrString(instance.Filter.Disabled))
}
content = append(content, table)
if instance.Filter != nil && len(instance.Filter.Attributes) > 0 {
filterTable := tables.NewTable()
filterTable.SetTitle("FILTER ATTRIBUTES")
filterTable.SetHeader("KEY", "LEVEL", "MATCHER", "VALUES")

Comment on lines +103 to +104
table := tables.NewTable()
table.AddRow("ID", instance.Id)

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 table should also have a title otherwise the output looks a bit off.

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