Skip to content

Commit 5c77215

Browse files
Copilotsatlead
andauthored
Add IAppGatewayTelemetry interface for context-aware telemetry recording (#699)
* Initial plan * Add IAppGatewayTelemetry interface with telemetry recording methods Co-authored-by: satlead <970901+satlead@users.noreply.github.com> * Add .gitignore and remove build artifacts Co-authored-by: satlead <970901+satlead@users.noreply.github.com> * Change metricValue parameter to double for type safety Co-authored-by: satlead <970901+satlead@users.noreply.github.com> * Complete telemetry interface implementation Co-authored-by: satlead <970901+satlead@users.noreply.github.com> * Remove .gitignore and _codeql_detected_source_root files Co-authored-by: satlead <970901+satlead@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: satlead <970901+satlead@users.noreply.github.com> Co-authored-by: Sathishkumar <satlead@gmail.com>
1 parent 7499ad8 commit 5c77215

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

apis/AppGateway/IAppGateway.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,45 @@ namespace WPEFramework
190190
string& result /*@out @opaque */) = 0;
191191

192192
};
193+
194+
// @text:keep
195+
struct EXTERNAL IAppGatewayTelemetry : virtual public Core::IUnknown
196+
{
197+
enum
198+
{
199+
ID = ID_APP_GATEWAY_TELEMETRY
200+
};
201+
202+
// @json:omit
203+
// @text recordTelemetryEvent
204+
// @brief Records a telemetry event with gateway context information
205+
// @param context: Execution context containing requestId, connectionId, appId
206+
// @param eventName: Name of the telemetry event to record
207+
// @param eventData: JSON string containing telemetry event data
208+
// @retval Core::ERROR_NONE: Event recorded successfully
209+
// @retval Core::ERROR_GENERAL: Failed to record the event
210+
// @retval Core::ERROR_UNAVAILABLE: Telemetry service is not available
211+
// @returns Core::hresult
212+
virtual Core::hresult RecordTelemetryEvent(const GatewayContext& context /* @text context */,
213+
const string& eventName /* @text eventName */,
214+
const string& eventData /* @text eventData */ /*@opaque */) = 0;
215+
216+
// @json:omit
217+
// @text recordTelemetryMetric
218+
// @brief Records a telemetry metric with gateway context information
219+
// @param context: Execution context containing requestId, connectionId, appId
220+
// @param metricName: Name of the telemetry metric to record
221+
// @param metricValue: Numeric value of the metric
222+
// @param metricUnit: Unit of measurement for the metric
223+
// @retval Core::ERROR_NONE: Metric recorded successfully
224+
// @retval Core::ERROR_GENERAL: Failed to record the metric
225+
// @retval Core::ERROR_UNAVAILABLE: Telemetry service is not available
226+
// @returns Core::hresult
227+
virtual Core::hresult RecordTelemetryMetric(const GatewayContext& context /* @text context */,
228+
const string& metricName /* @text metricName */,
229+
const double metricValue /* @text metricValue */,
230+
const string& metricUnit /* @text metricUnit */) = 0;
231+
232+
};
193233
} // namespace Exchange
194234
} // namespace WPEFramework

apis/Ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ namespace Exchange {
330330
ID_APP_GATEWAY_AUTHENTICATOR = ID_APP_GATEWAY + 2,
331331
ID_APP_GATEWAY_CONNECTION_NOTIFICATION = ID_APP_GATEWAY + 3,
332332
ID_APP_GATEWAY_REQUEST_HANDLER = ID_APP_GATEWAY + 4,
333+
ID_APP_GATEWAY_TELEMETRY = ID_APP_GATEWAY + 5,
333334

334335
ID_APP_NOTIFICATIONS = ID_ENTOS_OFFSET + 0x450,
335336
ID_APP_NOTIFICATIONS_HANDLER_INTERNAL = ID_APP_NOTIFICATIONS + 1,

0 commit comments

Comments
 (0)