diff --git a/.fleetControl/agentControl/agent-schema-for-agent-control.yml b/.fleetControl/agentControl/agent-schema-for-agent-control.yml new file mode 100644 index 0000000000..b93dc578e7 --- /dev/null +++ b/.fleetControl/agentControl/agent-schema-for-agent-control.yml @@ -0,0 +1,61 @@ +namespace: newrelic +name: com.newrelic.apm_java +version: 0.1.0 +variables: + k8s: + version: + description: "Java Agent init container version" + type: string + default: "latest" + required: false + podLabelSelector: + description: "Pod label selector" + type: yaml + default: { } + required: false + namespaceLabelSelector: + description: "Namespace label selector" + type: yaml + default: { } + required: false + env: + description: "environment variables to pass to Java agent" + type: yaml + default: [ ] + required: false + health_env: + description: "environment variables to pass to health sidecar" + type: yaml + default: [ ] + required: false + health_version: + description: "health sidecar image version" + type: string + default: "latest" + required: false +deployment: + k8s: + health: + interval: 30s + initial_delay: 30s + objects: + instrumentation: + apiVersion: newrelic.com/v1beta1 + kind: Instrumentation + metadata: + name: ${nr-sub:agent_id} + # APM CRs should be installed in "nr-ac:namespace" + # Due to a limitation in the k8s-agents-operator, Instrumentation CRs must be installed in the same namespace as the operator. + # Hence, the namespace is set to "nr-ac:namespace_agents". + # Reference: https://github.com/newrelic/k8s-agents-operator/blob/92c19208864f051f03f457ee04b772fca5042162/api/v1beta1/instrumentation_webhook.go#L110C27-L110C72 + namespace: ${nr-ac:namespace_agents} + spec: + agent: + language: java + image: newrelic/newrelic-java-init:${nr-var:version} + env: ${nr-var:env} + healthAgent: + image: newrelic/k8s-apm-agent-health-sidecar:${nr-var:health_version} + env: ${nr-var:health_env} + podLabelSelector: ${nr-var:podLabelSelector} + namespaceLabelSelector: ${nr-var:namespaceLabelSelector} diff --git a/.fleetControl/configurationDefinitions.yml b/.fleetControl/configurationDefinitions.yml new file mode 100644 index 0000000000..118933d6fb --- /dev/null +++ b/.fleetControl/configurationDefinitions.yml @@ -0,0 +1,17 @@ +configurationDefinitions: + - name: New relic java agent config for k8s + slug: java-config # How is this slug used, can agents pick whatever they want or does this need to match something in AC? + platform: kubernetes # would this just be k8s vs on-host or will there be a larger set of agreed-upon platform options + description: java agent configuration, provided by the user + type: java-config # How is this different from the slug and what is it used for? + format: yml # the format of the agent config file + version: 1.0.0 # this is the schema version + schema: ./schemas/java-config.json + - name: New relic java agent config for host + slug: java-config + platform: host + description: java agent configuration, provided by the user + type: java-config + format: yml + version: 1.0.0 + schema: ./schemas/java-config.json diff --git a/.fleetControl/schemas/java-config-1.0.0.json b/.fleetControl/schemas/java-config-1.0.0.json new file mode 100644 index 0000000000..74d3786a74 --- /dev/null +++ b/.fleetControl/schemas/java-config-1.0.0.json @@ -0,0 +1,401 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://newrelic.com/schemas/java-agent-configuration.json", + "title": "New Relic Java Agent Configuration Schema", + "description": "Schema for New Relic Java agent configuration (newrelic.yml)", + "type": "object", + "properties": { + "common": { + "type": "object", + "description": "Common configuration settings shared across all environments", + "properties": { + "license_key": { + "type": "string", + "minLength": 1, + "description": "New Relic license key", + "examples": ["<%= license_key %>", "your_license_key_here"] + }, + "agent_enabled": { + "type": "boolean", + "description": "Enable or disable the agent", + "default": true + }, + "app_name": { + "oneOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1 + } + ], + "description": "Application name(s) as they will appear in New Relic", + "examples": ["My Application", ["My App", "My App Staging"]] + }, + "high_security": { + "type": "boolean", + "description": "Enable high security mode", + "default": false + }, + "log_level": { + "type": "string", + "enum": ["off", "severe", "warning", "info", "fine", "finer", "finest"], + "description": "Log level for the agent", + "default": "info" + }, + "audit_mode": { + "type": "boolean", + "description": "Enable audit mode for debugging", + "default": false + }, + "log_file_name": { + "type": "string", + "description": "Name of the log file", + "default": "newrelic_agent.log" + }, + "log_limit_in_kbytes": { + "type": "integer", + "minimum": 0, + "description": "Maximum size of log file in kilobytes", + "default": 0 + }, + "log_daily": { + "type": "boolean", + "description": "Enable daily log rotation", + "default": false + }, + "proxy_host": { + "type": "string", + "description": "Proxy server hostname" + }, + "proxy_port": { + "type": "integer", + "minimum": 1, + "maximum": 65535, + "description": "Proxy server port" + }, + "proxy_user": { + "type": "string", + "description": "Proxy authentication username" + }, + "proxy_password": { + "type": "string", + "description": "Proxy authentication password" + }, + "capture_params": { + "type": "boolean", + "description": "Capture HTTP request parameters", + "default": false + }, + "ignored_params": { + "type": "string", + "description": "Comma-separated list of HTTP parameters to ignore" + }, + "error_collector": { + "type": "object", + "description": "Error collection configuration", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable error collection", + "default": true + }, + "capture_source": { + "type": "boolean", + "description": "Capture source code in error traces", + "default": false + }, + "ignore_errors": { + "type": "string", + "description": "Comma-separated list of exception classes to ignore" + }, + "ignore_classes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of exception classes to ignore" + }, + "ignore_status_codes": { + "type": "string", + "description": "Comma-separated list of HTTP status codes to ignore" + } + }, + "additionalProperties": false + }, + "transaction_tracer": { + "type": "object", + "description": "Transaction tracer configuration", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable transaction tracing", + "default": true + }, + "transaction_threshold": { + "oneOf": [ + { + "type": "string", + "enum": ["apdex_f"] + }, + { + "type": "number", + "minimum": 0 + } + ], + "description": "Threshold for transaction traces (seconds or 'apdex_f')", + "default": "apdex_f" + }, + "record_sql": { + "type": "string", + "enum": ["off", "obfuscated", "raw"], + "description": "SQL recording mode", + "default": "obfuscated" + }, + "explain_enabled": { + "type": "boolean", + "description": "Enable SQL explain plans", + "default": true + }, + "explain_threshold": { + "type": "number", + "minimum": 0, + "description": "Threshold for SQL explain plans (seconds)", + "default": 0.5 + }, + "stack_trace_threshold": { + "type": "number", + "minimum": 0, + "description": "Threshold for stack traces (seconds)", + "default": 0.5 + }, + "slow_query_threshold": { + "type": "number", + "minimum": 0, + "description": "Threshold for slow query traces (seconds)", + "default": 2.0 + } + }, + "additionalProperties": false + }, + "cross_application_tracer": { + "type": "object", + "description": "Cross application tracing configuration", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable cross application tracing", + "default": true + } + }, + "additionalProperties": false + }, + "thread_profiler": { + "type": "object", + "description": "Thread profiler configuration", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable thread profiling", + "default": true + } + }, + "additionalProperties": false + }, + "browser_monitoring": { + "type": "object", + "description": "Real User Monitoring (RUM) configuration", + "properties": { + "auto_instrument": { + "type": "boolean", + "description": "Enable automatic RUM injection", + "default": true + } + }, + "additionalProperties": false + }, + "class_transformer": { + "type": "object", + "description": "Class transformation configuration", + "properties": { + "com.newrelic.instrumentation.servlet-user": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "com.newrelic.instrumentation.spring-aop-2": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "labels": { + "type": "string", + "description": "Semicolon-separated list of key:value labels", + "examples": ["Server:One;Data Center:Primary"] + }, + "attributes": { + "type": "object", + "description": "Attribute configuration", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable attribute collection", + "default": true + }, + "include": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of attributes to include" + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of attributes to exclude" + } + }, + "additionalProperties": false + }, + "distributed_tracing": { + "type": "object", + "description": "Distributed tracing configuration", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable distributed tracing", + "default": false + } + }, + "additionalProperties": false + }, + "span_events": { + "type": "object", + "description": "Span events configuration", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable span events", + "default": true + }, + "max_samples_stored": { + "type": "integer", + "minimum": 0, + "description": "Maximum number of span events to store", + "default": 2000 + } + }, + "additionalProperties": false + }, + "application_logging": { + "type": "object", + "description": "Application logging configuration", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable application logging features", + "default": true + }, + "forwarding": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable log forwarding", + "default": true + }, + "max_samples_stored": { + "type": "integer", + "minimum": 0, + "description": "Maximum number of log events to store", + "default": 10000 + } + }, + "additionalProperties": false + }, + "metrics": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable logging metrics", + "default": true + } + }, + "additionalProperties": false + }, + "local_decorating": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable local log decoration", + "default": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "required": ["license_key", "app_name"], + "additionalProperties": false + }, + "development": { + "type": "object", + "description": "Development environment specific configuration", + "additionalProperties": true + }, + "test": { + "type": "object", + "description": "Test environment specific configuration", + "additionalProperties": true + }, + "production": { + "type": "object", + "description": "Production environment specific configuration", + "additionalProperties": true + }, + "staging": { + "type": "object", + "description": "Staging environment specific configuration", + "additionalProperties": true + } + }, + "required": ["common"], + "additionalProperties": { + "type": "object", + "description": "Custom environment configuration", + "additionalProperties": true + } +}