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(telemetry): introduce count for all Gateway API objects #4058

Merged
merged 6 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Adding a new version? You'll need three changes:
`pod-ip-address.my-namespace.pod`.
- `service`: will make KIC build addresses using the following template:
`pod-ip-address.service-name.my-namespace.svc`.
This is known to not work on GKE becuase it uses `kube-dns` instead of coredns.
This is known to not work on GKE because it uses `kube-dns` instead of `coredns`.
- Gateway's `AttachedRoutes` fields get updated with the number of routes referencing
and using each listener.
[#4052](https://github.com/Kong/kubernetes-ingress-controller/pull/4052)
Expand All @@ -165,6 +165,8 @@ Adding a new version? You'll need three changes:
database, allowing upgrades from one version of Kong Gateway to another without
tearing down the database.
[#4116](https://github.com/Kong/kubernetes-ingress-controller/pull/4116)
- Telemetry reports now include a count for every `gateway.networking.k8s.io` CRD.
[#4058](https://github.com/Kong/kubernetes-ingress-controller/pull/4058)

### Changed

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/jpillora/backoff v1.0.0
github.com/kong/deck v1.20.0
github.com/kong/go-kong v0.42.0
github.com/kong/kubernetes-telemetry v0.0.4
github.com/kong/kubernetes-telemetry v0.0.5
github.com/kong/kubernetes-testing-framework v0.31.0
github.com/lithammer/dedent v1.1.0
github.com/miekg/dns v1.1.54
Expand Down Expand Up @@ -67,6 +67,7 @@ require (
golang.org/x/net v0.10.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
k8s.io/klog/v2 v2.100.1 // indirect
)

require (
Expand Down Expand Up @@ -189,7 +190,6 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/cli-runtime v0.27.2 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/kubectl v0.27.2 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ github.com/kong/deck v1.20.0 h1:q8+8VBnvv0O+9mYjcPdJP5prG3KzbvR4XfePwkTx+Zc=
github.com/kong/deck v1.20.0/go.mod h1:yJWEu6/xnYiaNBg2vP4EsYLtbt33J67Zsolye3JpJmI=
github.com/kong/go-kong v0.42.0 h1:N0Rth32eGq6S5x33Txu+Gv9ZJ3gG5noffDjqezwutfA=
github.com/kong/go-kong v0.42.0/go.mod h1:YUq7A3gcwk+9Z1ajwzVY2HnSyL/IKq/TJHsJDqT8hJM=
github.com/kong/kubernetes-telemetry v0.0.4 h1:6iDDocM4b/pIKJ/KrSSoQjvyaHBIBtBb4U9LdOqg8Js=
github.com/kong/kubernetes-telemetry v0.0.4/go.mod h1:xopN/XY+5xCXoY8kfnjHf83yT6n4ezVcWKJxA7gmJUw=
github.com/kong/kubernetes-telemetry v0.0.5 h1:FCJx1ShFXbqNb2K6N9FE3MZKwCkp8CEVAJuej5+1S9U=
github.com/kong/kubernetes-telemetry v0.0.5/go.mod h1:FrAXjZHEPSAEL4aUXnNOpPoRiA68VJvwgN8dfG/qF60=
github.com/kong/kubernetes-testing-framework v0.31.0 h1:3MTlUeiD/jV3ArdZWfRLidi7kchg19HI222dXQHwasw=
github.com/kong/kubernetes-testing-framework v0.31.0/go.mod h1:RKFMHJCDByNnHiw+hRLwR26eIZRgd5ImhwYjwK+yUQg=
github.com/kong/semver/v4 v4.0.1 h1:DIcNR8W3gfx0KabFBADPalxxsp+q/5COwIFkkhrFQ2Y=
Expand Down
16 changes: 11 additions & 5 deletions internal/manager/telemetry/manager.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telemetry

import (
"crypto/tls"
"fmt"
"strings"
"time"
Expand All @@ -22,10 +23,13 @@ import (
"github.com/kong/kubernetes-ingress-controller/v2/internal/util"
)

const (
splunkEndpoint = "kong-hf.konghq.com:61833"
telemetryPeriod = time.Hour
var (
SplunkEndpoint = "kong-hf.konghq.com:61833"
SplunkEndpointInsecureSkipVerify = false
TelemetryPeriod = time.Hour
)
programmer04 marked this conversation as resolved.
Show resolved Hide resolved

const (
prefix = "kic"
SignalStart = prefix + "-start"
SignalPing = prefix + "-ping"
Expand Down Expand Up @@ -56,14 +60,16 @@ func CreateManager(restConfig *rest.Config, gatewaysCounter workflows.Discovered
dyn := dynamic.New(k.Discovery().RESTClient())

m, err := createManager(k, dyn, cl, gatewaysCounter, fixedPayload, rv,
telemetry.OptManagerPeriod(telemetryPeriod),
telemetry.OptManagerPeriod(TelemetryPeriod),
telemetry.OptManagerLogger(logger),
)
if err != nil {
return nil, err
}

tf, err := forwarders.NewTLSForwarder(splunkEndpoint, logger)
tf, err := forwarders.NewTLSForwarder(SplunkEndpoint, logger, func(c *tls.Config) {
c.InsecureSkipVerify = SplunkEndpointInsecureSkipVerify
})
if err != nil {
return nil, fmt.Errorf("failed to create telemetry TLSForwarder: %w", err)
}
Expand Down