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

Add Admin port and group all ports in one file #1442

Merged
merged 8 commits into from
Mar 27, 2019

Conversation

yurishkuro
Copy link
Member

@yurishkuro yurishkuro commented Mar 24, 2019

Which problem is this PR solving?

Health checks, metrics, and other housekeeping data should not be exposed on the ports that also serve public APIs

Short description of the changes

  • combines health check and metrics handlers on a single admin port. There are breaking changes:
    • agent metrics move from /sampling config port to the new admin port 14271
    • query metrics move from /api port to the former health check port 16687
    • collector metrics move from HTTP API port to the former health check port 14269
    • ingestor metrics move from standalone port 14271 to the health check port 14270
  • groups all numeric port numbers in a single file ports/ports.go for easier reference
  • consolidates common boilerplate code in all binaries into a Service type
  • flag health-check-http-port is deprecated and replaced by admin-http-port
  • ingester's DefaultHTTPPort = 14271 is deprecated and repurposed as the agent's admin port

@codecov
Copy link

codecov bot commented Mar 24, 2019

Codecov Report

Merging #1442 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1442   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files         165     165           
  Lines        7539    7510   -29     
======================================
- Hits         7539    7510   -29
Impacted Files Coverage Δ
cmd/ingester/app/flags.go 100% <ø> (ø) ⬆️
cmd/builder/builder_options.go 100% <ø> (ø) ⬆️
cmd/agent/app/builder.go 100% <ø> (ø) ⬆️
cmd/query/app/flags.go 100% <100%> (ø) ⬆️
cmd/agent/app/reporter/tchannel/flags.go 100% <100%> (ø) ⬆️
pkg/healthcheck/handler.go 100% <100%> (ø) ⬆️
plugin/storage/cassandra/options.go 100% <100%> (ø) ⬆️
cmd/collector/app/builder/builder_flags.go 100% <100%> (ø) ⬆️
cmd/agent/app/flags.go 100% <100%> (ø) ⬆️
plugin/storage/memory/factory.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc48919...cbccc24. Read the comment docs.

Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

LGTM apart from a couple of questions and one suggestion.


// AddFlags registers CLI flags.
func (s *AdminServer) AddFlags(flagSet *flag.FlagSet) {
flagSet.Int(healthCheckHTTPPort, 0, "(deprecated) The http port for the health check service")
Copy link
Contributor

Choose a reason for hiding this comment

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

We have other deprecated options as well and I don't think they follow a standard:

--cassandra-archive.enable-dependencies-v2        DEPRECATED: Jaeger will...
--span-storage.type string                        Deprecated; please use SPAN_STORAGE_TYPE...

Deprecated; seems to be most used pattern. One good practice is also to point users to the property that is replacing the deprecated value. In this case, the adminHTTPPort:

flagSet.Int(healthCheckHTTPPort, 0, "(deprecated) The http port for the health check service. See " + healthCheckHTTPPort)

Copy link
Member Author

Choose a reason for hiding this comment

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

Normalized all flags to (deprecated) see {replacement flag}

// See the License for the specific language governing permissions and
// limitations under the License.

package ports
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? O_O

Copy link
Member Author

Choose a reason for hiding this comment

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

I added an explanation to CONTRIBUTING.md

@jpkrohling
Copy link
Contributor

This is a breaking change that will probably impact everyone who is using Jaeger in production, as they are probably monitoring Jaeger via Prometheus. We should communicate this change as loud as possible.

Yuri Shkuro added 8 commits March 26, 2019 19:40
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
…ment}

Signed-off-by: Yuri Shkuro <ys@uber.com>
@yurishkuro yurishkuro merged commit 95c69cc into jaegertracing:master Mar 27, 2019
@yurishkuro yurishkuro deleted the add-admin-port branch March 27, 2019 00:44
@gouthamve
Copy link
Contributor

Hi All, super appreciate the project and all the work that goes into it. I just spent an hour wondering where my metrics went only to find this PR. I could find nothing in the release notes. In the future can we make sure to have an PR label that release leads could look at to find all breaking changes?

Or maybe have a draft changelog that is updated with every PR by the PR author?

@yurishkuro
Copy link
Member Author

@gouthamve apologies, we missed it from release notes. I added a PR #1595 to indicate this was a breaking change.

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.

Vulnerable data exposed with metrics endpoint Move /metrics from the query port to internal (health-check)
3 participants