Just display whatever is available. If user agent or any other header is
not available, just ignore that case. Ideally, in the dashboard the user
should be able to customize what he sees.

On Mon, Nov 23, 2015 at 3:59 PM, Isuru Perera <[email protected]> wrote:

> Yes. That's what I wanted to tell. Even in AS context, will the clients
> for JAX-RS services send a "useful" User-Agent header? I haven't included
> the "UA Parser" in the HTTP Monitoring Interceptor. I can include it and it
> will add another dependency to MSS. However I want to know whether parsing
> User-Agent is really necessary for Microservices or any service endpoints,
> which are not accessed through a web browser.
>
> Please note that the country and language are taken from request "Locale".
> As I understand, there is no way to get these details also.
>
> On Mon, Nov 23, 2015 at 11:41 AM, Sagara Gunathunga <[email protected]>
> wrote:
>
>>
>>
>> On Mon, Nov 23, 2015 at 10:59 AM, Sumedha Rubasinghe <[email protected]>
>> wrote:
>>
>>>
>>>
>>> On Fri, Nov 20, 2015 at 5:20 PM, Isuru Perera <[email protected]> wrote:
>>>
>>>> As I mentioned, in Tomcat Valve, we get some details from the
>>>> User-Agent header.
>>>>
>>>> See following code from WebAppMonitoringPublisherValve.java
>>>> <https://github.com/wso2/carbon-deployment/blob/master/components/monitoring/org.wso2.carbon.as.monitoring/src/main/java/org/wso2/carbon/as/monitoring/collector/http/WebAppMonitoringPublisherValve.java#L250-L256>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *Client readableUserAgent =
>>>> uaParser.parse(userAgent);webappMonitoringEvent.setUserAgentFamily(readableUserAgent.userAgent.family);webappMonitoringEvent.setUserAgentVersion(readableUserAgent.userAgent.major);webappMonitoringEvent.setOperatingSystem(readableUserAgent.os.family);webappMonitoringEvent.setOperatingSystemVersion(readableUserAgent.os.major);webappMonitoringEvent.setDeviceCategory(readableUserAgent.device.family);*
>>>>
>>>> We can access headers from Netty request, but the real question is
>>>> whether the Microservices clients will send a User-Agent header similar to
>>>> the header sent by a Browser.
>>>>
>>>
>>> Isuru,
>>> If this is about client not setting header values, that problem has
>>> nothing to do with MicroServices. right?
>>> It can be the same for any JAX-RS hosted on AS.
>>>
>>
>> Yes, here nothing to do with Microservices, even in same dashboard under
>> AS context won't work in case client don't send those headers and we really
>> can't do anything further.
>>
>> Thanks !
>>
>>>
>>>
>>>>
>>>> In the valve, other details are taken from the request object.
>>>>
>>>> With Netty, we should be able to get the remote address from the Netty
>>>> Channel. However, I couldn't find a way to access the channel from our
>>>> HTTPMonitoringInterceptor
>>>> <https://github.com/wso2/product-mss/blob/v1.0.0-alpha/carbon-mss/components/org.wso2.carbon.mss/src/main/java/org/wso2/carbon/mss/httpmonitoring/HTTPMonitoringInterceptor.java>.
>>>> In addition the Tomcat Value gets language and country from Locale
>>>> <https://github.com/wso2/carbon-deployment/blob/master/components/monitoring/org.wso2.carbon.as.monitoring/src/main/java/org/wso2/carbon/as/monitoring/collector/http/WebAppMonitoringPublisherValve.java#L208-L209>.
>>>>
>>>>
>>>> <https://github.com/wso2/product-mss/blob/v1.0.0-alpha/carbon-mss/components/org.wso2.carbon.mss/src/main/java/org/wso2/carbon/mss/httpmonitoring/HTTPMonitoringInterceptor.java>
>>>>
>>>> Even here, can we expect these details in Microservices context?
>>>>
>>>>
>>>> On Fri, Nov 20, 2015 at 4:51 PM, Sagara Gunathunga <[email protected]>
>>>> wrote:
>>>>
>>>>>
>>>>> What we have in AS is not AS specific dashboard, it's a HTTP dashboard
>>>>> and possible to use with anywhere related to HTTP monitoring. As we
>>>>> discussed we need some sophisticated dashboards for MSS but
>>>>> HTTP monitoring is something basic and essential for MSS as well,
>>>>> HTTP monitoring is a very basic requirement for any service or app.
>>>>>
>>>>> As I understood current problem is,  it's not possible to extract some
>>>>> of the HTTP request headers from Netty in order to render some parts of
>>>>> above dashboard, IMHO we need to find a way to exact all HTTP headers from
>>>>> Netty.
>>>>>
>>>>> Can you list down list of required HTTP headers that we can't extract
>>>>> from current API ?  May be Kasun can help out here.
>>>>>
>>>>> Thanks !
>>>>>
>>>>> On Fri, Nov 20, 2015 at 4:05 PM, Isuru Perera <[email protected]> wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> For the MSS alpha release, we used the HTTP Monitoring Dashboard used
>>>>>> in WSO2 AS product and we implemented an HTTP Monitoring Interceptor for
>>>>>> MSS [1].
>>>>>>
>>>>>> However, with MSS we don't get all data required by the standard HTTP
>>>>>> Monitoring Dashboard. For example, in the Tomcat Valve for AS [2], we 
>>>>>> have
>>>>>> used the User-Agent header to get client details (Browser, OS & Device).
>>>>>> The Tomcat Request object has all other necessary details (Remote IP,
>>>>>> Locale etc)
>>>>>>
>>>>>> In our interceptor [3], we use the Netty HTTP Request object and the
>>>>>> Java Reflection details to get details for the monitoring event.
>>>>>>
>>>>>> Since these details are not enough for the HTTP Monitoring Dashboard,
>>>>>> we need to think of using an MSS specific dashboard.
>>>>>>
>>>>>> WDYT?
>>>>>>
>>>>>> With regarding to Metrics annotations, we have to create some gadgets
>>>>>> in DAS. We need to have a discussion on this.
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>> Best Regards,
>>>>>>
>>>>>> [1] https://github.com/wso2/product-mss/pull/31
>>>>>> [2]
>>>>>> https://github.com/wso2/carbon-deployment/blob/master/components/monitoring/org.wso2.carbon.as.monitoring/src/main/java/org/wso2/carbon/as/monitoring/collector/http/WebAppMonitoringPublisherValve.java
>>>>>> [3]
>>>>>> https://github.com/wso2/product-mss/blob/v1.0.0-alpha/carbon-mss/components/org.wso2.carbon.mss/src/main/java/org/wso2/carbon/mss/httpmonitoring/HTTPMonitoringInterceptor.java
>>>>>>
>>>>>> --
>>>>>> Isuru Perera
>>>>>> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
>>>>>> Lean . Enterprise . Middleware
>>>>>>
>>>>>> about.me/chrishantha
>>>>>> Contact: +IsuruPereraWSO2
>>>>>> <https://www.google.com/+IsuruPereraWSO2/about>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sagara Gunathunga
>>>>>
>>>>> Architect; WSO2, Inc.;  http://wso2.com
>>>>> V.P Apache Web Services;    http://ws.apache.org/
>>>>> Linkedin; http://www.linkedin.com/in/ssagara
>>>>> Blog ;  http://ssagara.blogspot.com
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Isuru Perera
>>>> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
>>>> Lean . Enterprise . Middleware
>>>>
>>>> about.me/chrishantha
>>>> Contact: +IsuruPereraWSO2
>>>> <https://www.google.com/+IsuruPereraWSO2/about>
>>>>
>>>
>>>
>>>
>>> --
>>> /sumedha
>>> m: +94 773017743
>>> b :  bit.ly/sumedha
>>>
>>
>>
>>
>> --
>> Sagara Gunathunga
>>
>> Architect; WSO2, Inc.;  http://wso2.com
>> V.P Apache Web Services;    http://ws.apache.org/
>> Linkedin; http://www.linkedin.com/in/ssagara
>> Blog ;  http://ssagara.blogspot.com
>>
>>
>
>
> --
> Isuru Perera
> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
> Contact: +IsuruPereraWSO2 <https://www.google.com/+IsuruPereraWSO2/about>
>



-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>*
*email: **[email protected]* <[email protected]>
* cell: +94 77 3320919blog: **http://blog.afkham.org*
<http://blog.afkham.org>
*twitter: **http://twitter.com/afkham_azeez*
<http://twitter.com/afkham_azeez>
*linked-in: **http://lk.linkedin.com/in/afkhamazeez
<http://lk.linkedin.com/in/afkhamazeez>*

*Lean . Enterprise . Middleware*
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to