-
Notifications
You must be signed in to change notification settings - Fork 137
OpenShift Support: Product Telemetry #4038
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
base: main
Are you sure you want to change the base?
Changes from all commits
4103612
06c853d
aeb9042
4bc9935
014b64b
1d9dd4a
3d58eb3
db96078
b7d7dd9
5e5a3c5
a3d5a8e
2d34749
00b418d
8022051
c9b7a7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ type ConfigurationGetter interface { | |
// Data is telemetry data. | ||
// | ||
//go:generate go run -tags generator github.com/nginx/telemetry-exporter/cmd/generator -type=Data -scheme -scheme-protocol=NGFProductTelemetry -scheme-df-datatype=ngf-product-telemetry | ||
type Data struct { | ||
type Data struct { //nolint //required to skip golangci-lint-full fieldalignment | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you need nolint here? |
||
// ImageSource tells whether the image was built by GitHub or locally (values are 'gha', 'local', or 'unknown') | ||
ImageSource string | ||
tel.Data // embedding is required by the generator. | ||
|
@@ -66,6 +66,8 @@ type Data struct { | |
ControlPlanePodCount int64 | ||
// NginxOneConnectionEnabled is a boolean that indicates whether the connection to the Nginx One Console is enabled. | ||
NginxOneConnectionEnabled bool | ||
// BuildOS is the OS the NGF and NGINX binary was built on. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically this just checks the OS of NGF right? Do we know the expected functionality if somebody builds NGF with ubi but then tries to use NGINX in the other os? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I'm not really sure how that would work, or if it even can. I guess nothing really stops anyone from mixing them |
||
BuildOS string | ||
} | ||
|
||
// NGFResourceCounts stores the counts of all relevant resources that NGF processes and generates configuration from. | ||
|
@@ -121,6 +123,8 @@ type DataCollectorConfig struct { | |
Version string | ||
// ImageSource is the source of the NGF image. | ||
ImageSource string | ||
// BuildOS is the OS the NGF and NGINX binary was built on. | ||
BuildOS string | ||
// Flags contains the command-line NGF flag keys and values. | ||
Flags config.Flags | ||
// NginxOneConsoleConnection is a boolean that indicates whether the connection to the Nginx One Console is enabled. | ||
|
@@ -187,6 +191,7 @@ func (c DataCollectorImpl) Collect(ctx context.Context) (Data, error) { | |
}, | ||
NGFResourceCounts: graphResourceCount, | ||
ImageSource: c.cfg.ImageSource, | ||
BuildOS: c.cfg.BuildOS, | ||
FlagNames: c.cfg.Flags.Names, | ||
FlagValues: c.cfg.Flags.Values, | ||
SnippetsFiltersDirectives: snippetsFiltersDirectives, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need to add the field to the "Normal Case" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, what is "normal case"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll still need the check you had before and like in ImageSource where BUILD_OS could be something else besides ubi or it could be empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjberman pointed out in here that we should just be able to access it directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, os.Getenv("BUILD_OS") should be directly accessible in this file (probably even just in the collector file), but we'll still need to check the value of it. Since it could be empty and we don't want to pass that empty value in and would rather pass in something like "unknown" or "alpine"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah fair point. I'll update that too.