Context
PR #633 adds an AppLogStream that emits error messages to app developers when their syslog drain is misconfigured (#579). The current implementation emits two log lines per error — one with source type LGR and one with SYS:
logclientOption := loggregator.WithAppInfo(appID, "LGR", "")
appLogStream.logClient.EmitLog(message, logclientOption)
logclientOption = loggregator.WithAppInfo(appID, "SYS", appLogStream.sourceIndex)
appLogStream.logClient.EmitLog(message, logclientOption)
This was copied from syslog_connector.go's emitLoggregatorErrorLog, which used it specifically for dropped message notifications. The new AppLogStream is used more broadly (validation errors, connectivity issues, etc.).
Problem
- Duplication: Every error produces two identical log lines in the app's log stream, which is confusing for app developers.
- Historical precedent: The old
filtered_binding_fetcher emitted only with LGR. The dual pattern appears specific to the syslog connector's dropped-message alerts, not a general convention.
Proposal
Emit a single log line per error using LGR with sourceIndex for traceability:
logclientOption := loggregator.WithAppInfo(appID, "LGR", appLogStream.sourceIndex)
appLogStream.logClient.EmitLog(message, logclientOption)
Open Questions
- Are there existing automations, dashboards, or alerting rules that depend on filtering by
SYS or LGR source type for these messages?
- If not, should syslog drain errors use
LGR, SYS, or both?
- Should the existing dual-emit in
syslog_connector.go also be aligned for consistency?
References
Context
PR #633 adds an
AppLogStreamthat emits error messages to app developers when their syslog drain is misconfigured (#579). The current implementation emits two log lines per error — one with source typeLGRand one withSYS:This was copied from
syslog_connector.go'semitLoggregatorErrorLog, which used it specifically for dropped message notifications. The newAppLogStreamis used more broadly (validation errors, connectivity issues, etc.).Problem
filtered_binding_fetcheremitted only withLGR. The dual pattern appears specific to the syslog connector's dropped-message alerts, not a general convention.Proposal
Emit a single log line per error using
LGRwithsourceIndexfor traceability:Open Questions
SYSorLGRsource type for these messages?LGR,SYS, or both?syslog_connector.goalso be aligned for consistency?References