pomerium/internal/telemetry/util.go
Caleb Doxsey d5178f24a3
config: support multiple running services in addition to all-in-one mode (#5656)
## Summary
Currently you can either run a single service or all-in-one mode. This
PR adds support for running any 2 or 3 services together. For example
`services: authorize,proxy`.

I think I updated the conditions to make sense, but there's some risk
here as there may have been some assumptions in places I'm overlooking.

## Related issues
-
[ENG-2485](https://linear.app/pomerium/issue/ENG-2485/core-support-running-multiple-but-not-all-services)


## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-07-21 14:28:31 -06:00

15 lines
395 B
Go

package telemetry
import "strings"
// ServiceName turns a pomerium service option into the appropriate external label for telemetry purposes
//
// Ex:
// service 'all' -> 'pomerium'
// service 'proxy' -> 'pomerium-proxy'
func ServiceName(service string) string {
if strings.Count(service, ",") > 0 || service == "all" || service == "" {
return "pomerium"
}
return "pomerium-" + service
}