feat(nodejs): gRPC TLS/DNS failover, 12 runtime meters, Java agent.core alignment#140
Closed
songzhendong wants to merge 1 commit into
Closed
Conversation
Rebased onto apache/skywalking-nodejs master @ 36df516 (apache#139). Fork CI: PR #7. Signed-off-by: songzhendong <songzhendong@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the Node.js agent remote layer to align with the Java
agent.coregRPC architecture, and expands runtime metrics from 6 to 12instance_nodejs_*meters.GRPCChannelManagermulti-backend failover, TLS/mTLS, per-hostname SNI, DNS expand (A/AAAA), optional periodic DNS re-resolve, IPv6formatHostPort,CommandServiceingestion.array_buffers,uptime,peak_malloced_memory,detached_contexts,old_space_used,new_space_used); canonical envSW_AGENT_RUNTIME_METRICS_*with legacy aliases retained.Not in this PR: OAP MAL rules / dashboards (separate PR required), release version bump, Profile/Log/Event clients, full Command executor registration.
Motivation
GRPCChannelManager, TLS, DNS expansion, and periodic re-resolve; Node previously lacked equivalent failover and TLS/SNI behavior (notably Kubernetes Headless Service → Pod IP with cert hostname mismatch).agent.corelayout; v2 completes remote connectivity features on that foundation.OAP companion (required for 12-meter dashboards)
Meter reporting is in this PR. OAP consumption (MAL analyzer + dashboard docs + e2e-v2 TLS/DNS/auth cases) is a separate PR to
apache/skywalking:meter-analyzer-config/nodejs-runtime.yamldocs/en/setup/backend/dashboards-nodejs-runtime.mdtest/e2e-v2/cases/nodejs/*test/e2e-v2/script/env→SW_AGENT_NODEJS_COMMIT=7c7eba5Companion OAP PR: songzhendong/skywalking #6.
Intentional differences from Java (please review)
UNAUTHENTICATED/PERMISSION_DENIED)SW_AGENT_RUNTIME_METRICS_MAX_SNAPSHOTS_PER_REPORTdefault 1configto appsConfig.Agent.AUTHENTICATIONreadablepublicAgentConfigomitsauthorizationOperational constraints (DNS lookup blocking, runtime sampling on main thread, etc.):
docs/nodejs-grpc-constraints.md.Key env vars (new / renamed)
SW_AGENT_IS_RESOLVE_DNS_PERIODICALLYcollector.is_resolve_dns_periodically)SW_AGENT_GRPC_CHANNEL_CHECK_INTERVALSW_AGENT_FORCE_RECONNECTION_PERIODSW_AGENT_FORCE_TLS/SW_AGENT_SSL_*SW_AGENT_COLLECTOR_GRPC_UPSTREAM_TIMEOUTSW_AGENT_RUNTIME_METRICS_*SW_AGENT_NODEJS_RUNTIME_METRICS_*as canonical)Legacy
SW_AGENT_NODEJS_RUNTIME_METRICS_*,SW_AGENT_NVM_*aliases still accepted with deprecation warnings.Test plan
Agent CI (Actions run @
7c7eba5):static-failover,dns-re-resolve) × 20/22/24OAP e2e-v2 (songzhendong/skywalking #6, pin
7c7eba5):Files of note
src/agent/core/remote/*src/agent/core/commands/*src/agent/core/meter/*tests/remote-e2e/*tests/remote/*docs/nodejs-grpc-constraints.md