Considering what all of you have expressed, one option is to let the user
pass in a predefined environment variable which will have a unique ID to
identify the specific micogateway. If this env variable is not set we will
set a default value for the label. This way, even with multiple
micorgateway instances generated using the same label can have different
IDs if they need to be identified separately from each instance.

Apart from that, when the micorgateway is not generated using a label,
still the instance can be identified and filtered for analytics.

One downside is, still we cannot backtrack the label(if a label was used)
from the micorgateway instance.


On Wed, Aug 8, 2018 at 11:47 PM Nuwan Dias <[email protected]> wrote:

> I don't think using project name is a good idea. Because project is a
> development time thing, decided by the developer setting up the
> Microgateway development stage. The runtime of the Gateway may have no
> relevance to the "project".
>
> On Wed, Aug 8, 2018 at 11:33 PM Malintha Amarasinghe <[email protected]>
> wrote:
>
>>
>> On Wed, Aug 8, 2018 at 7:58 PM, Rajith Roshan <[email protected]> wrote:
>>
>>>
>>>
>>> On Wed, Aug 8, 2018 at 7:33 PM Nuwan Dias <[email protected]> wrote:
>>>
>>>> How about introducing it as an annotation (custom of course) to the
>>>> Ballerina code itself?
>>>>
>>> This seems to be the most easiest way, But one micro gw can have
>>> multiple apis  , then annotation have to be copied for each api.
>>> Other way is to add it to micro-gw conf (toml) while copying it to the
>>> distribution when building the distribution.
>>>
>>>>
>>>> On Wed, Aug 8, 2018 at 5:46 PM Fazlan Nazeem <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Is there a way to extract the microgateway label from the runtime?
>>>>> This is because we need to publish this information to the Stream 
>>>>> Processor
>>>>> for analytics. Although we do not have any charts which filter statistics
>>>>> depending on the label, this may come up as a requirement in the future.
>>>>> Additionally, there should be some mechanism to know what label is
>>>>> associated with each microgateway. Once the micro-gateway is generated,
>>>>> this information doesn't seem to be retrievable.
>>>>>
>>>> And also micro gateway can be built without  label also. It can fetch
>>> an api from name and version, so there won't be label at that time.  Then
>>> we have only the project name. Can't we use project name for this.
>>>
>>
>> Yes we need to think about both situations; micro-gw for a label and
>> single API.
>>
>> I think we are basically trying to identify which microgateway the event
>> is coming from.
>> If we take the label approach, let's say if we generate two microgw 
>> distributions
>> using the label "accounts" and then make them work together using a LB,
>> both of them will be having a same identifier "accounts". We will not be
>> able to see how many requests each "accounts" microgws got individually.
>>
>> So I also think a mechanism using project name or any other way of
>> setting a unique ID for each gateway would be better. And we need to have a
>> seperate mechanism to identify which microgw with ID has which label (or
>> the API).
>>
>>
>>>
>>>>> Currently, the value for the label field is predefined in the source
>>>>> code. According to an offline chat with Malintha, we may have to burn the
>>>>> label into the microgw-conf file during gateway building phase or persist
>>>>> this info in some other means. Any suggestions?
>>>>>
>>>>
>>>
>>>>> --
>>>>> Thanks & Regards,
>>>>>
>>>>> *Fazlan Nazeem*
>>>>> Senior Software Engineer
>>>>> WSO2 Inc
>>>>> Mobile : +94772338839
>>>>> [email protected]
>>>>>
>>>>
>>>>
>>>> --
>>>> Nuwan Dias
>>>>
>>>> Director - WSO2, Inc. http://wso2.com
>>>> email : [email protected]
>>>> Phone : +94 777 775 729
>>>>
>>>
>>>
>>> --
>>> Rajith Roshan
>>> Senior Software Engineer, WSO2 Inc.
>>> Mobile: +94-717-064-214
>>>
>>
>>
>>
>> --
>> Malintha Amarasinghe
>> *WSO2, Inc. - lean | enterprise | middleware*
>> http://wso2.com/
>>
>> Mobile : +94 712383306
>>
>
>
> --
> Nuwan Dias
>
> Director - WSO2, Inc. http://wso2.com
> email : [email protected]
> Phone : +94 777 775 729
>


-- 
Thanks & Regards,

*Fazlan Nazeem*
Senior Software Engineer
WSO2 Inc
Mobile : +94772338839
[email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to