-- Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
--
-- this file licensed under the Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2
--
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
-- PURPOSE.
-- See the Mulan PSL v2 for more details.
--
-- Author: auto generate
-- Create: 2025-4-27
-- Description: DO NOT EDIT; Code generated by "main.lua.mako"

require 'skynet.manager'
local skynet = require 'skynet'
local logging = require 'mc.logging'
local observability_app = require 'observability_app'

local CMD = {}

function CMD.exit()
    logging:notice('observability service exit')
end

skynet.start(function()
    skynet.uniqueservice('sd_bus')
    skynet.register('observability')
    local ok, err = pcall(observability_app.new)
    if not ok then
        logging:error('observability start failed, err: %s', err)
    end
    skynet.dispatch('lua', function(_, _, cmd, ...)
        local f = assert(CMD[cmd])
        skynet.ret(skynet.pack(f(...)))
    end)
end)