Skip to content

ccl, sql: add telemetry, logs for feature denials by feature flags#57328

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
angelapwen:add-telemetry-for-blocked-features
Dec 2, 2020
Merged

ccl, sql: add telemetry, logs for feature denials by feature flags#57328
craig[bot] merged 1 commit intocockroachdb:masterfrom
angelapwen:add-telemetry-for-blocked-features

Conversation

@angelapwen
Copy link
Copy Markdown

This change adds a telemetry counter, sql.feature_flag.denied, in
the case where a feature is denied by its corresponding feature flag
being set to disabled in cluster settings. It also adds a log
warning for the database administrator to view the denied command
as well as its optional category.

Release note: none

@angelapwen angelapwen requested review from a team, joshimhoff, miretskiy and otan and removed request for a team December 1, 2020 21:23
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Author

@angelapwen angelapwen left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @joshimhoff, @miretskiy, and @otan)


pkg/sql/sqltelemetry/feature_flags.go, line 17 at r1 (raw file):

// FeatureDeniedByFeatureFlagCounter is a counter that is incremented every time a feature is
// denied via the feature flag cluster setting, for example. feature.schema_change.enabled = FALSE.
var FeatureDeniedByFeatureFlagCounter = telemetry.GetCounterOnce("sql.feature_flag.denied")

I wasn't quite sure whether this should be considered within the sql category of telemetry considering it should log from other packages. But given that it is under sqltelemetry folder and that other ccl tests also use sql.* for telemetry I left it this way.


pkg/sql/testdata/telemetry/feature_flags, line 24 at r1 (raw file):

sql.feature_flag.denied

# Test that an IMPORT is counted.

I cannot run the Bulk IO commands in this package, but also do not see where telemetry can be tested within the ccl package. I see some logic tests in ccl/logictestccl but the relevant commands also cannot be accessed in that directory. Do you think it is necessary to test the telemetry for Bulk IO features considering I already have the schema change and CREATE STATISTICS/ANALYZE tested? It certainly should work as the counter is incremented within the featureflag.CheckEnabled method.

@angelapwen angelapwen force-pushed the add-telemetry-for-blocked-features branch from 713b65a to bc79c94 Compare December 1, 2020 22:53
Copy link
Copy Markdown
Contributor

@otan otan left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 44 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @angelapwen, @joshimhoff, @miretskiy, and @otan)


pkg/featureflag/feature_flags.go, line 39 at r2 (raw file):

		log.Warningf(
			ctx,

this logging may get excessive. maybe let's try with a higher verbosity, i.e. if log.V(2) { log.Warningf(ctx, ...) }


pkg/sql/sqltelemetry/feature_flags.go, line 17 at r1 (raw file):

Previously, angelapwen (Angela P Wen) wrote…

I wasn't quite sure whether this should be considered within the sql category of telemetry considering it should log from other packages. But given that it is under sqltelemetry folder and that other ccl tests also use sql.* for telemetry I left it this way.

hmm, yeah this is fine!


pkg/sql/testdata/telemetry/feature_flags, line 24 at r1 (raw file):

Previously, angelapwen (Angela P Wen) wrote…

I cannot run the Bulk IO commands in this package, but also do not see where telemetry can be tested within the ccl package. I see some logic tests in ccl/logictestccl but the relevant commands also cannot be accessed in that directory. Do you think it is necessary to test the telemetry for Bulk IO features considering I already have the schema change and CREATE STATISTICS/ANALYZE tested? It certainly should work as the counter is incremented within the featureflag.CheckEnabled method.

it's okay, i think you can skip it :)

Copy link
Copy Markdown
Author

@angelapwen angelapwen left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @joshimhoff, @miretskiy, and @otan)


pkg/featureflag/feature_flags.go, line 39 at r2 (raw file):

Previously, otan (Oliver Tan) wrote…

this logging may get excessive. maybe let's try with a higher verbosity, i.e. if log.V(2) { log.Warningf(ctx, ...) }

Thanks that makes sense!!


pkg/sql/sqltelemetry/feature_flags.go, line 17 at r1 (raw file):

Previously, otan (Oliver Tan) wrote…

hmm, yeah this is fine!

Cool thanks!


pkg/sql/testdata/telemetry/feature_flags, line 24 at r1 (raw file):

Previously, otan (Oliver Tan) wrote…

it's okay, i think you can skip it :)

Yay okay!

@angelapwen angelapwen force-pushed the add-telemetry-for-blocked-features branch from bc79c94 to a253e7c Compare December 2, 2020 00:09
@blathers-crl blathers-crl bot requested a review from otan December 2, 2020 00:09
Copy link
Copy Markdown
Contributor

@otan otan left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @angelapwen, @joshimhoff, @miretskiy, and @otan)


pkg/featureflag/feature_flags.go, line 39 at r2 (raw file):

Previously, angelapwen (Angela P Wen) wrote…

Thanks that makes sense!!

you can do this in a later PR, but were you planning to add a graph to the admin UI as well?

@angelapwen
Copy link
Copy Markdown
Author


pkg/featureflag/feature_flags.go, line 39 at r2 (raw file):

Previously, otan (Oliver Tan) wrote…

you can do this in a later PR, but were you planning to add a graph to the admin UI as well?

Ah... you're right, I had thought the time series graph was somehow created automatically but I realize that's not true 😸

// This can be either a literal NULL (deletion), or a string containing YAML.
// We also support byte arrays for backward compatibility with
// previous versions of CockroachDB.
// previous versions of CockrofachDB.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor nit s/CockrofachDB/CockroachDB/g

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you @odeke-em! I missed that, will fix.

@angelapwen angelapwen force-pushed the add-telemetry-for-blocked-features branch 7 times, most recently from 1af557d to 644311a Compare December 2, 2020 04:37
This change adds a telemetry counter, sql.feature_flag_denied, in
the case where a feature is denied by its corresponding feature flag
being set to disabled in cluster settings. It also adds a level 2
log warning for the database administrator to view the denied
command as well as its optional category.

Release note: none
@angelapwen angelapwen force-pushed the add-telemetry-for-blocked-features branch from 644311a to 2bd3d11 Compare December 2, 2020 08:34
@angelapwen
Copy link
Copy Markdown
Author

bors r=otan

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 2, 2020

Build succeeded:

@craig craig bot merged commit d3f73b9 into cockroachdb:master Dec 2, 2020
@angelapwen angelapwen deleted the add-telemetry-for-blocked-features branch February 5, 2021 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants